Forum Replies Created
-
AuthorReplies
-
I am not the one responsible for deploying it, but as I understand it, the guys deploying one of my applications are using Sun Cluster softare for high availability. Apparently it is kind of difficult to install Cloverleaf on the cluster though, you have to set it up under a different user than hci and modify all the perl script to use your new user. I’m not sure why hci doesn’t work on the cluster, but according to them, it doesn’t. They say if you can get cloverleaf setup under a different user /home/bob for example, then it can be handled by the cluster to failover onto different nodes. The biggest problem seems to be fixing the perl scripts which have the hci user hardcoded.
I can try to answer more questions on this subject, but I think I’ve explained most of what I know about it.
OK, then I suggest you search for “form based file upload” or “rfc 1867”, and you will definitely find ASP code for handling the file save from this tcl proc. Well, I notice you’re referring to HTTP Put, which I haven’t used. You could try HTTP POST with the file upload syntax. I modified an existing HTTP POST function to use “form based file upload” like in RFC 1867 using mime type multipart/form-data instead of the normal HTTP POST mime type application/x-www-form-urlencoded. If you’re interested in trying this, the tcl file is attached. The function you need is “ins_BPMS_PostMsg”. It takes a parameter url, and xml (which it posts as normal form data), and x12 which is a variable holding the contents of an X12 file (could be any file, nothign X12 specific about it).
Anyway, if you just need to upload a file, you can use this tcl proc and strip the xml variable from it and just follow the model used for the x12 variable as your file to upload. Your webserver needs to know what to do with the file, it doesn’t just automatically save it somewhere. For example, you could have a servlet that read the contents of the post and saved the file upload contents to a local file, or an ASP, or whatever server side code you’re using. I happened to use Quovadx’s BPMS which gets file upload contents into a binary handle, then you can easily tell it to save that handle as a file. There are lots of examples on the web of server side code to handle file uploads.
Jesse
PS. Well, Clovertech won’t let me add this file as an attachment, so sorry, I have to post the code inline here
Code:
proc ins_BPMS_PostMsg { url xml x12 } {
set newline “x0Dx0A”
set outputData {}
set bound “—–NEXT_PART_[clock seconds].[pid]”
# add the x12 file contents to the data to upload
append outputData “–$bound${newline}Content-Disposition: form-data; name=”QDXResponseX12″; filename=”X12″;${newline}Content-Type: application/edi-x12${newline}${newline}$x12${newline}”
# add the xml data to the data to upload
append outputData “–$bound${newline}Content-Disposition: form-data; name=”QDXResponse”${newline}${newline}$xml${newline}”
# add the signal that the upload is done
append outputData “–${bound}–${newline}”set cfg [list [list URL $url] [list DATA $outputData]
[list HEADERS [list
[list CONTENT-TYPE “multipart/form-data; boundary=$bound”]]]]
set res [httppost $cfg]
set status [keylget res “STATUS”]
set body [keylget res “BODY”]
set statCode [lindex $status 1]# debug
puts “CFG IS $cfg”
puts “STATUS IS $status”
puts “STATUS CODE IS $statCode”
#puts “RESULT IS $res”if {$statCode <= 299} { puts "SUCCESS HTTP POST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" puts "" puts "" return } else { puts "FAILED HTTP POST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" puts "" puts "" return [list $statCode $body] } }
-
AuthorReplies