File Upload

  • Thread starter Craig Dahlinger
  • Start date
C

Craig Dahlinger

Is there a way to use the <Input Type="file> control to just browse for file
names and not actually upload the file. I only want to provide a utillity
for the end user to browser for the file path, which is on a network share.
I do not want the file uploaded. I cannot seem to stop the control from
uploading the file, even when I remove the runat="server" tag.

Any ideas are welcome...

Thanks
CD
 
R

ranganh

Dear Craig,

Already, the input type="file" just shows the file path. Only if you write the logic for uploading it to the server, the user may be able to do the same.

if you just provide input type=file, it will just show the path which can be browsed.

So just provide the same and dont write the logic for uploading to the server.

Hope it helps.
 
A

Alvin Bruney [MVP]

let me know if this works, i've been trying to do the same thing but
couldn't figure it out
 
J

Jeff J.

This was bothering me, since I wasn't sure you could use clearAttributes() properly on a file input. Sadly, after experimenting for a while, the only thing I could find that cleared the value was by storing the outerHTML in a variable on page load, and then restoring that variable to the control before submit.

var inputCachedHTML;
function BeforeFormSubmit() {
document.getElementById('txtXMLOutput').value +=
document.getElementById('myFileInput').value;
document.getElementById('myFileInput').outerHTML = inputCachedHTML;
return true;
}

In the body tag, use:
onload="inputCachedHTML = document.getElementById('myFileInput').outerHTML;"

I hope that's useful to someone. :)

~ Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top