File name displayed after upload
Is it possible for the ASP file to display the file name of the file uploaded, after the upload is done? What I'm looking for is a user uploads a file, then a second page or results page would display the filename of the file uploaded, also file size would be nice.
Answer:
With GP's Pure ASP Upload you could do this:
If (CStr(Request.QueryString("GP_upload")) <> "") Then
Response.Write UploadRequestForm("file")
end if
If you have multiple file fields this would--if the fields are named numerically, i.e. file1, file2, file3--work:
If (CStr(Request.QueryString("GP_upload")) <> "") Then
for im = 1 to 3
Response.Write UploadRequestForm("file"&im)
next
end if
Alternately multiple fields can also be handled:
If (CStr(Request.QueryString("GP_upload")) <> "") Then
Response.Write UploadRequestForm("file1")
Response.Write UploadRequestForm("file2")
Response.Write UploadRequestForm("file3")
end if
You can put the above code on the upload page, before any redirects that you might have. You should even switch those off otherwise you won't see the output.
See also this related FAQ
Comments
Brillinat bit of kit
You must me logged in to write a comment.