WebSpeed File upload questions

miroc

New Member
Sample code (from one of the other treads):
Code:
<HTML>
<BODY>
    <script language="SpeedScript">
        DEFINE VAR mFile AS MEMPTR NO-UNDO.
        DEFINE VAR cfile AS CHAR NO-UNDO.
 
    IF get-value('upload') <> '' THEN do:
        ASSIGN mFile = get-binary-data("UploadFile").
        IF mFile <> ? THEN DO:
           {&out} 'Uploaded to: ' + get-config("fileUploadDirectory":U).
               ASSIGN  cfile      = get-value('UploadFile')
                       cfile_dest = get-config("fileUploadDirectory":U) + '\' + entry(num-entries(cfile),cfile,'\').
                 {&out} 'Uploaded as: ' + cfile_dest.
                COPY-LOB FROM mFile TO FILE cfile_dest NO-CONVERT.

        END.
        else
            {&out} 'Invalid file uploaded: ' + get-value('UploadFile').
    END.
    </script>
    <FORM ENCTYPE="multipart/form-data"  ACTION="fileupload.r" METHOD="POST">
    <input type=file name="UploadFile">
    <INPUT type="submit" value='upload' name="upload">
    </FORM>
</BODY>
</HTML>
Questions:
1. Can I use get-binary-data function with Progress v10.0? (I get compilation error)
2. When I check line: *** cfile = get-value('UploadFile') *** cfile value is just file name and not full file path, so I have problems finding file. How to get full path of the file?

Note: I have task to add upload file option to one form (And I'm relatively new to WebSpeed, HTML and JavaScript). I would appreciate any suggestion.
 

chrisadam2

New Member
I'm a newbie in speedscript. I currently develop in procedure editor. I'm wondering how can i use SHIFT+F2 for the syntax check or even run the code.

_________________________________________________________

Want to get-on Google's first page and loads of traffic to your website? Hire a SEO Specialist from Ocean Groups seo pecialist
 

Cecil

19+ years progress programming and still learning.
Sample code (from one of the other treads):
Code:
<HTML>
<BODY>
    <script language="SpeedScript">
        DEFINE VAR mFile AS MEMPTR NO-UNDO.
        DEFINE VAR cfile AS CHAR NO-UNDO.
 
    IF get-value('upload') <> '' THEN do:
        ASSIGN mFile = get-binary-data("UploadFile").
        IF mFile <> ? THEN DO:
           {&out} 'Uploaded to: ' + get-config("fileUploadDirectory":U).
               ASSIGN  cfile      = get-value('UploadFile')
                       cfile_dest = get-config("fileUploadDirectory":U) + '\' + entry(num-entries(cfile),cfile,'\').
                 {&out} 'Uploaded as: ' + cfile_dest.
                COPY-LOB FROM mFile TO FILE cfile_dest NO-CONVERT.

        END.
        else
            {&out} 'Invalid file uploaded: ' + get-value('UploadFile').
    END.
    </script>
    <FORM ENCTYPE="multipart/form-data"  ACTION="fileupload.r" METHOD="POST">
    <input type=file name="UploadFile">
    <INPUT type="submit" value='upload' name="upload">
    </FORM>
</BODY>
</HTML>
Questions:
1. Can I use get-binary-data function with Progress v10.0? (I get compilation error)
2. When I check line: *** cfile = get-value('UploadFile') *** cfile value is just file name and not full file path, so I have problems finding file. How to get full path of the file?

Note: I have task to add upload file option to one form (And I'm relatively new to WebSpeed, HTML and JavaScript). I would appreciate any suggestion.

The get-binary-data method was introduced OpenEdge 10.1A.
Also get-value('UploadFile') will only return the filename not the full path.
 
Top