Solved

File Uploads

Posted on 2003-10-30
4
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Saqib Khan
Saqib Khan 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

734 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