473,545 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ 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 10850
"Axe" <wa*@too.much.s pam> wrote in
news:7D******** **************@ newsread2.prod. itd.earthlink.n et:
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
20462
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? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
4
6691
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 any file and i.e. i dont want. Can any one suggest me? Cheers, Bhavin
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 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...
2
28347
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 call submitButton.click() Unfortunately it does not work while file_filed.vale = <path_to_file> has no effect, value <INPUT type=file...> cound not be...
10
3065
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 like it tried to do it but errored... I thought changeing the max size for the file input box to about 100mb would fix it but nope here is my page...
1
1662
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 control dynamically? If so which one is it ? Ot I how can I create dynamic input file controls in asp.net: - I got the following code to build...
6
8093
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 text field, he must use the browse button. i tried a lot of codes but no one works for both IE and firefox i tried to use onclick="blur",m but in that...
4
9060
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 file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a...
1
4606
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 about this. <pre> <a id="myobj" href="#" onclick="document.getElementById('test').click(); ">Click me</a> <input type="file" id="test"...
0
7420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7446
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6003
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4966
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1908
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 we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.