How to retrieve a file uploaded to the server?

Mar 7, 2013 at 9:26 PM

How do I retrieve a file uploaded from a form using method="POST" enctype="multipart/form-data"?

Mar 7, 2013 at 11:48 PM
You should be able to access the file that you uploaded from your code. The default for where it's uploaded is \temp but that can be changed. The following info is returned with the upload (from the demo):

1 File(s) Uploaded!
The first file is c:\avfp6\temp\FLL2012 Certificate Generic (2).ppt, Size: 630784, Original Name: FLL2012 Certificate Generic (2).ppt

The second file is , Size: , Original Name:

The third file is , Size: , Original Name:

The 1st value you entered is:

The 2nd value you entered is:

The 3rd value you entered is:

File1 extension and stem are: .ppt and c:\avfp6\temp\FLL2012 Certificate Generic (2)

File1 elapsed time for upload: 0

File2 elapsed time for upload:
Mar 8, 2013 at 2:20 AM

I saw in the code that it went to the temp folder but I wondered how I would know the name of the file. I f I just look in the temp folder I could be grabbing files from different users and not the one I want.

Mar 8, 2013 at 10:25 AM
Edited Mar 8, 2013 at 10:40 AM
You can always have the user log in and pass that info (or any other text fields like in the example form) along with the upload. All of that info is associated with the upload. The code for getting the file name is in that sample app (from ):
* do the upload     
    lnFiles = oUpload.HttpUpload(oProp.AppStartPath+'temp')
                    <td width="149%">
                    <%= oUpload.lnfCount %> File(s) Uploaded!
                    <p>The first file is <%=oUpload.getfilename('FILE1')%>,
                    Size: <%=oUpload.getfilesize('FILE1')%>, Original Name:
                    <p>The second file is <%=oUpload.getfilename('FILE2')%>,
                    Size: <%=oUpload.getfilesize('FILE2')%>, Original Name:
                    <p>The third file is <%=oUpload.getfilename('FILE3')%> ,
                    Size: <%=oUpload.getfilesize('FILE3')%>, Original Name:
                    <%=oUpload.getfileorig('FILE3') %></p>
                    <p>The 1st value you entered is: <%=oUpload.getmform('test')%></p>
                    <p>The 2nd value you entered is: <%=oUpload.getmform('test2')%></p>
                    <p>The 3rd value you entered is: <%=oUpload.getmform('test3')%></p>
                    <p>File1 extension and stem are: <%=oUpload.getfileex('FILE1')+[ and ]+oUpload.getfilestem('FILE1')%></p>
                    <p>File1 elapsed time for upload:<%=oUpload.getelapsedtime('FILE1')%></p>
                    <p>File2 elapsed time for upload:<%=oUpload.getelapsedtime('FILE2')%>
Mar 9, 2013 at 1:30 AM
I think what led to a little confusion was the class name AVFPHTTPUpload. I did not realize until I analysed the source code that the upload had already taken place and that the AVFPHTTPUpload class was merely retrieving the data from the Request object. The class itself had nothing really to do with the uploading process. Once I understood that everything else made sense and it works just fine.

Mar 17, 2013 at 9:54 PM
when I run Upload1.avfp and Upload2.avfp always shows 0 file uploaded and the folder TEMP also empty only.
What could be the reason ? IIS setting or missing class in my AVFP ? please help.
Mar 18, 2013 at 1:56 PM
Edited Mar 18, 2013 at 2:31 PM
Assuming you chose a file to upload, the Temp folder has to be writable. Check permissions.