Hi all,
Uploading was not possible in webspeed 2. but they said now with version 3.1 (or openedge) it is possible.
I've been searching in the Webspeed Developpers Guide, but there's no answer, i've also searched the forums, no luck either.
Does anyone know how to upload a file/image through a web-page?
--> i know how to make the HTML, but not the code behind.
Thanks for everything.
There was a discussion about this very subject on the WebSpeed list of the PEG (www.peg.com).
This code, should do what you want:
DEF VAR mFile AS MEMPTR NO-UNDO.
mFile = get-binary-data("MyFile")
CREATE MyTable.
COPY-LOB from mFile to MyTable.Myblob NO-CONVERT.
Where "MyFile" is the input in the HTML.
The original post can be found here:
http://www.peg.com/lists/webspeed/web/msg09215.html
yes, this could work.
but i would rather copy it to a folder.
so i thought this:
ASSIGN mFile = get-binary-data("txtBestand").
IF mFile <> ? THEN DO:
ASSIGN cfile = hosturl + "/folder/test.jpg".
COPY-LOB FROM mFile TO FILE cFile NO-CONVERT.
END.
ASSIGN mFile = ?.
--> i upload picture.jpg.
this doesn't work. or i don't see it in my folder.
even i don't have any fault message in my log.
what is wrong?
If you put a check in for the value of mFile, does it return a valid value?
it always replies "?"
--> i allready made this line into tagmap.dat:
input,,file,fill-in,web/support/webinput.p
but i don't think this is correct.
Because it is not really a fill-in.
Click on the link I posted earlier and follow the thread using the 'Thread Next' links. There was some follow up information about the form headers (enctype, etc).
i followed it and it works!!
but i have one extra question.
in the progress explorer tool you have "binary upload max size". what is it? MB or KB or B?
Excellent!!
Bytes.. According to the help:
Binary Upload Max Size
The maximum size of a BLOB (binary large object) data type. The default is 0, no BLOB support. Specify the maximum file size in bytes.