Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

File Uploads

Posted on 2003-10-30
4
Medium Priority
?
290 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 1200 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 800 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 1200 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

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!
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…

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