Fileupload using the PUT Method

JamesBowen

19+ years progress programming and still learning.
Hi all.

How do you uploads a binary file to WebSpeed using the PUT method (not the POST method). I am currently writing a webDAV server using WebSpeed and I need to handle a variety of http methods one of which a PUT.

Other HTTP request methods are OPTIONS / HEAD / PROPFIND / MKCOL / DELETE / GET / LOCK / UNLOCK

So how do I get the binary data if I am not using the POST request method?

NOTE:
get-binary-data function only works with POST.

INFO:
OE 10.2ASP02
Apache 2.2
Redhat 4 SE.

ADDITIONAL INFO:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6
http://www.webdav.org/
 
Correction: Using the get-binary-data function only works with Encapsulation type "multipart/form-data" which is used as part of a POST request method.

The PUT Method uses the Encapsulation type "application/octet-stream".

Also the Upload directory which is configured for the webspeed agent does not contain any binary files only ones which are text format.

Here is an example of uploading a file from the command line using cURL to a PUT enable webserver

Code:
cat testimage.jpg | curl -T - -v --basic -u "james:1james" http://webdave.somedomin.com/images/testimage.jpg
 
Progress Software US have said that I can't do it.

Basically Progress have turnaround and said that the OpenEdge WebSpeed in not HTTP 1.1 compliant. This sucks, WebSpeed has not changed a lot in the last 10+ years. With more and more applications being converted over to Web Based, so WebSpeed should have a major overhaul if they want to keep up with the likes of PHP ASP.NET etc. I am getting tired of having to struggle in finding alternative solutions because WepSpeed/ABL can't/won't handle simple web requests.

So I need your help to vote for my Enhancement Request please
http://www.progress.com/cgi-bin/ers.cgi/dspreq.htm?lenhreq=0000004035
 
I do belive I have come up with a work around to the problem. The problem is that the WEB-CONTEXT:FORM-LONG-CGI truncates at the first null character in the stream.

So my solution in is to encode the binary stream into an base64 string before the data is piped to the cgiip messenger. Then within the WebSpeed Agent I am then able to decode the BASE64 string back into a binary value.

This is only a workaround solution and it does have extra overhead in CPU and network resources, but it does work.
 
Thats a good idea. I agree regarding webspeed. It could use a serious update. One annoyance with uploads on webspeed, you cant even define the path for the upload in your script. Its one central definition in the ubroker.properties. There is so much focus on .net integation for GUI on windows with openedge but with so many apps going browser based whats with the lack of updates to webspeed? If you are on a progress DB you are pretty much stuck with webspeed. Its frustrating especially if you are someone coming from working with PHP or ASP.NET. It would be nice if webspeed had some baked in classes that are native for handling common tasks. paging, sorting, uploads... and better integration with the webserver whether Apache or IIS. The world is not going all GUI client Progress. it will be moving toward web based applications.
 
Back
Top