Solved

File Uploads

Posted on 2003-10-30
4
264 Views
Last Modified: 2013-12-24
I am trying to put a File Upload box on a page and have it populated with an entry - "c:\test.txt". The user can then modify the entry. I tried the below code but nothing was in the box. What am I doing wrong?


<p><input type="file" name="F1" size="20" value="c:\test.txt"></p>
0
Comment
Question by:Neal Hartman
  • 2
4 Comments
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 300 total points
ID: 9653441
You can't preset the value in a File Upload control...

<p><input type="file" name="F1" size="20"></p>
0
 
LVL 23

Assisted Solution

by:adilkhan
adilkhan earned 200 total points
ID: 9667408
Thats a Security Issue.

Imagine you saved your passwords into a file c:\passwords.txt

and on my site i have a File upload Field and users will Push the button to upload files.
This way they can upload their Text Files(Holding passwords) without a notice and it is a Serious Security Issue.

if that was possible people could set the path as the form hidden field to(eg, c:\passwords.txt)  and get Values from hard Drive without a notice.

I hope you got the point.
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 300 total points
ID: 9668752
Yes - part of it's a security issue - part of it's user interaction. When the INPUT FILE type was first implemented, the problem with including the value attribute was that there was potential - for user's that needed to upload many files - of simply uploading the same file again and again (this is an inherent issue with the component, unless you move to an asp file upload component which allows for synchronous multiple file upload)

Coupled with the potential for abuse, it was determined that the ability to set a predetermined value for the file type would not be included as a user-agent component. As far as I know, every browser has adopted that model, and so there's no way to set it from the receiving site.
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 9670437
Got the idea, thanks.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now