By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Multiple File Upload W/ One <input type=file> control

P: n/a
Axe
Here's the problem: I've got an ASP.NET (C#) web page that has a single
<input type=file> control on it for uploading a file. The way the code
works is that the uploaded file is then parsed for the path and file name.
I then save the posted file to a temporary directory on the web server (for
later processing). I then open up a file stream and stream reader and read
a related file into a string that is in the posted file's same directory
(and has the same filename; just a different file type).

This works great and wonderful when I test it on my development machine and
my test machine. However, when I test it remotely, the posted file's path
is relative the user's local machine. When the web server attempts to find
that related file it fails because it doesn't have the same path as the
user's local machine.

Am I confusing anyone as much as I'm confused?

Bottom line, we can't have two input controls for the upload process. I
need to get to that second file. How? I know the local path but the web
server can't deal with that can it?

Thanks for your help.
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Axe" <wa*@too.much.spam> wrote in
news:7D**********************@newsread2.prod.itd.e arthlink.net:
Bottom line, we can't have two input controls for the upload process.
I need to get to that second file. How? I know the local path but
the web server can't deal with that can it?

Thanks for your help.


You can upload exactly one file per <input type=file> tag. There's no way
around that. You also can't script those tags (that would be a gaping
security hole).

If the client needs to send 2 files to the server, then there will have to
be 2 <input type=file> tags, and the user will have to type in (or browse
to) 2 separate filenames.

Mark
Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.