473,909 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

INPUT type=file problem

I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">

I'm passing the value of FileName as part of the Query String and assigning
it like so:

FileName = Request.QuerySt ring("FileName" )

It is definitely being passed/assigned correctly - I have this line for
debugging purposes:

Response.Append ToLog "FileName=" & FileName

which outputs the following in the webserver log file (abbreviated for
space):

GET /content/UploadDB.asp FileName=D:\Dat abase\ClassTool .mdb 200

The question is - why isn't the file name showing up in the INPUT box?

May 19 '06 #1
3 1601
Ron Hinds wrote:
I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">


Modern brwsers will not allow setting the value attribute of INPUT elements
of type "file", as it's a security hole that could be used by hackers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #2
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:ea******** ******@TK2MSFTN GP03.phx.gbl...
Ron Hinds wrote:
I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">
Modern brwsers will not allow setting the value attribute of INPUT

elements of type "file", as it's a security hole that could be used by hackers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Thanks - that, at least, explains it! I was just trying to provide
convenience for my end users but I guess they will have to "suffer" ;-)

May 19 '06 #3
"Ron Hinds" wrote ...
Thanks - that, at least, explains it! I was just trying to provide
convenience for my end users but I guess they will have to "suffer" ;-)


I faced the same problem a few years back - there is a way around it - but
not just by popping the value into the box...

Take a look at the SoftArtisans website (www.softartisans.com) - we use the
SA-FileUp product, and in one application in conjunction with XFile (another
of their products) - this will allow this to be done as it'll use their
component as opposed to the standard INPUT box...

Of course, this might all be more effort than you want make, I know it felt
that way for me - which is why I kept re-iterating to my boss that it
couldn't be done - alas - he didn't have any of it and we got the component.
In our scenario - we use it "blindly" - ie, we just pass the component a
file name and it simply takes it from the users PC and starts the upload
process (this is used on our corporate network as opposed to on a www
environment so a little naughty)...I seem to remember that there were
options for whether the process was hidden or not...

Regards

Rob
May 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3651
by: Oxygenearth | last post by:
Please who could help me with this... I had my structure in Win32, with Apache, PHP, and MySQL, I had a page in which I am transfering an image to the database in MySQL using PHP. But now I am in Apache/Linux/MySQL(FreeBSD) with the same files. My problem is.. when I try to submit the variables to the php file, this does not get the binFile, in other words, the file($_POST) does not pass throug the SUBMIT html statemenT, so it is not...
2
9934
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background color and text. The file paths I'd like displayed in a textarea and then the files uploaded at once.
5
1622
by: Alon Zilkha | last post by:
Hi All, I just noticed a problem with Internet Explorer on Service Pack 2 of Windows XP and it is driving me insane!! I would greatly appreciate it if someone could help me out... I have a basic asp file (test.asp) with the following code: ---------------------------------------- <%
1
2111
by: Pavan Jha | last post by:
Hi, I am using File Input for one of my pages. I have multiple inputs on my page as <INPUT Type=FILE Name=File1> <INPUT Type=FILE Name=File2> and so on... I have a function for validating filetype which is called on onChange
2
2988
by: Quick Function | last post by:
For the <input type="file">, can I select directory? Multiple directories? Thanks, qq
15
4790
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
3
2834
by: Maris Janis Vasilevskis | last post by:
Hi, I create a binary file on client side using ActiveX. Now, I need to upload it. First idea - hidden Input type=file Does not work, because value is read only. A quickly made working solution: Visible input type=file
6
8116
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 case the field and "browse button" didn't work here's what i've done: <form name="form1"> ...
4
9102
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 project where client javascript requests an image server to generate dynamic images. The client...
8
2699
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a contact_us.php page.Now i can get all the inputs at the other end else the input(type/file) i donot want a submit button what i want that some how io can send the file name and the path of the picture that is to be uploaded and send to a page via ajax...
0
10037
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11348
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10540
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9727
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8099
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7249
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5938
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6140
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4776
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

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.