TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-05-2009, 11:42 AM   #1 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 35
Thanks: 1
dhaval is on a distinguished road
Default File Upload from text box

Hello friends,

I want to upload any image to write down the path in text box.
just write down the path in textbox and after submitting file should upload.

can anyone help me?
dhaval is offline  
Reply With Quote
Old 12-05-2009, 12:07 PM   #2 (permalink)
The Contributor
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 65
Thanks: 2
maeltar is on a distinguished road
Default

That doesn't make a great deal sense to me to be honest..

Are want to upload a file to a server using php and be able to browse to the file on your local pc ?

Google is your friend...

http://www.tizag.com/phpT/fileupload.php
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Old 12-05-2009, 01:30 PM   #3 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 338
Thanks: 2
Enfernikus is on a distinguished road
Default

Not possible unless it's a web accessible path or you use Java which can access your file system.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Old 12-05-2009, 01:39 PM   #4 (permalink)
The Contributor
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 65
Thanks: 2
maeltar is on a distinguished road
Default

Have I missed the aim on this ?

And to be correct, it needs to be a part of the filesystem that the web daemon (or user the daemon runs as) can WRITE to..

Am still not 100% what dhaval wants to achieve (I might be having a dense day)
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Old 12-05-2009, 08:19 PM   #5 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,270
Thanks: 17
Village Idiot is on a distinguished road
Default

Please don't cross post, you've been asked not to do this a number of times. It is annoying and does not help since the same people watch both forums.

So what you want to do is put multiple paths in a text box and have them all uploaded? This is not possible for the following reasons:

1. File upload fields must use a different form encoding than plain text forms.
2. If you look at the data sent, file upload forms send far more than the file path.
Village Idiot is offline  
Reply With Quote
Old 12-06-2009, 07:12 PM   #6 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Adding onto what Village Idiot said, it is also not possible to set the value of a file input with javascript. For example this jQuery will produce an error and not work:

javascript Code:
jQuery(function(){

    jQuery('input[type=text]').keyup(function(){
   
        // Get value of text box
        var text = jQuery(this).val();
       
        // Set value of file box (produces error)
        jQuery('input[type=file]').val(text);
   
    });

});
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 12-06-2009, 09:41 PM   #7 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 338
Thanks: 2
Enfernikus is on a distinguished road
Default

Quote:
Originally Posted by ETbyrne View Post
Adding onto what Village Idiot said, it is also not possible to set the value of a file input with javascript. For example this jQuery will produce an error and not work:

javascript Code:
jQuery(function(){

    jQuery('input[type=text]').keyup(function(){
   
        // Get value of text box
        var text = jQuery(this).val();
       
        // Set value of file box (produces error)
        jQuery('input[type=file]').val(text);
   
    });

});
The reason for the above should be fairly obvious, imagine let's say that the file input value WAS settable via JavaScript ( or any other method for that matter ) important confidential files could be set silently by just having several file inputs on the page upon load hidden via css. Press Submit, the next page takes a while to load but you just attribute it to a laggy connection. Meanwhile, the fiends are absconding with your precious files.
__________________
My Blog
Enfernikus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php/html form to echo text file contents Hustle Absolute Beginners 2 03-10-2009 06:14 AM
Read Text File in Reverse buildakicker General 9 11-26-2008 05:43 PM
HELP! File Upload d4v1d General 2 09-12-2008 06:52 PM
upload file galleeandfarel Absolute Beginners 2 07-11-2008 11:23 AM
Database export to text file... d4v1d Absolute Beginners 5 01-09-2008 03:30 PM


All times are GMT. The time now is 04:40 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design