Solved

File Uploads

Posted on 2003-10-30
4
284 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] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
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…
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…

705 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