473,472 Members | 1,882 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 10835
"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
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
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
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
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
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
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
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
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
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
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
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.