failed upload text file to server

kawasaky

New Member
hello, recently i started to work with WebSpeed and in this days i had been some problems with the fileUpload instruction, to be more specific i dont undersand at all how the action works

ACTION="http://<yourhost>/<msngr path>/<msngr>/ping"

i´ve been working with this:

<FORM ENCTYPE="multipart/form-data" ACTION="http://localhost/primera.p" METHOD="POST">
<INPUT type="file" name="filename">
<INPUT type="submit">'
</FORM>

in the action instruction, i guess i need something else but a du not what, i guess the problem is in the part <msngr path>/<msngr> cause i du not what instructions put there, in the Ubroker.properties i´ve put the instrucion fileUploadDirectory=C:\WebSidepa\UpLoad, one more thing :biggrin:, do you think theres a folder that i must to configure to? i hope you can help me... thanks
 
Well,

It's fairly easy. The FileUpload dir has to exists and have the right permissions, it should be on the server where the agent runs (most times not the webserver).
The action has to point to you webspeed installation. With that I mean:
on windows/IIS webserver something like:
http://hostname/scripts/cgiip.exe/WService=wsbroker1/<program-name>

On Linux/Apache webserver something like: http://hostname/cgi-bin/cgiip.exe/WService=wsbroker1/<program-name>.

localhost works only locally (e.g. messenger/agent and webbrowser on the same machine).

The WService=part has to point to the name of your webspeed broker. The program-name could be any (existing) program name if you don't use binary upload.
If you use binary upload you have to write the copy to disk part yourself e.g.:

Code:
{ src/web2/wrap-cgi.i}
DEFINE VARIABLE mFile AS MEMPTR NO-UNDO.
DEFINE VARIABLE cFile AS CHARACTER  NO-UNDO.
 
ASSIGN mFile = get-binary-data("Put here the name of the input type=file field you use in hte upload HTML page").
IF mFile <> ? THEN DO:
   ASSIGN cfile = get-value("Put here the name of the input type=file field you use in hte upload HTML page").
   COPY-LOB FROM mFile TO FILE cFile NO-CONVERT.
END.
ASSIGN mFile = ?.

HTH,

Casper.
 
Back
Top