Displaying uploaded file name via JavaScript
Question:
How can I display the file name via a javascript function after an upload completes? Rather than the Pure ASP Upload redirects to a new page, it would display a box with the information.
Answer:
At the end of your page before the body tag add the following code:
<% dim fileField
filefield=Request.QueryString("fileField")
If fileField<>"" Then
Response.Write "<script language=""javascript"" type=""text/javascript""> window.alert(""File " & fileField & " successfully uploaded!""); </script>"
End If %>
Where fileField is the name of your input field of your form.
NOTE: Works only with GET method. Make sure your form's method is set to GET.
Comments
Nice idea
Not the best way of using this idea of yours.
Nice try though.
You must me logged in to write a comment.