473,480 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
1 10836
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
20457
by: Don | last post by:
Is there some way to populate the "Browse" box for a <input type=file...> with a default value? I can do it for <input type=text...>, but can't seem to do it for <input type=file...>. Any ideas?...
4
6688
by: Bhavin | last post by:
Hi I'm trying to input image file using this synax. <input type=file name="tx_file" accept="image/*" class=boxText> But when open file dialouge appears, it shows all the file and user can select...
0
577
by: Axe | last post by:
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...
2
28319
by: Evgeny Zoldin | last post by:
Hi ALL. I need to simulate send POST data ( - file upload) as it was submitted in Browser. In C# I create instanse of IE, navigate to page with the form, fill in the fields and try to Submit by...
10
3059
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page...
1
1657
by: Irfan Akram | last post by:
Hi Guys, I am creating dynamic controls in asp.net. I am having problems creating dynamic Htmlinputfile controls, and even after being created I cannot view it. Is there a way of creating such a...
6
8087
by: reiyel | last post by:
hiya all i would like to ask some help for a little javascript, here's my problem: i have a html page with a <input type="file"> box, problem is i don't want the user to be able to write on the...
4
9054
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
1
4599
by: paragbhavsar | last post by:
Hello Friends, Can we simulate click event of Input File Control through Javascript - I want this for Firefox 3.5 browser ? I have also tried with following code. Please let me know solution...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.