I have a form that, when submitted, uploads a file into an invisible iframe on the same page. Does anyone know of a way that I can then access the filename of this file using javascript?
@mataichiJul 08.2009 — #Ok, so I made a few assumptions.
Here is a basic outline of how I handle this issue.
I assume you have a page and you are uploading a file. You want to upload the file, but not refresh the entire page, so you use an invisible iframe to do this.
So your <form> has some action like action="SaveFile.asp" which is where the file is actually upload to your server.
After I save the file here I call a javascript function from my asp page like this.... [CODE]<script language="javascript" type="text/javascript"> window.top.window.stopUpload('<%=thisFileNm%>'); </script> [/CODE]
Then from the stopUpload() function, I can create a hidden element with a value of the file name that I passed and insert it into the document somewhere.