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, 12:42 PM   #1 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
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, 01:07 PM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
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, 02:30 PM   #3 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
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, 02:39 PM   #4 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
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, 09:19 PM   #5 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
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, 08: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, 10:41 PM   #7 (permalink)
The Addict
 
Enfernikus's Avatar
 
Join Date: Jun 2008
Posts: 335
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
Old 01-29-2013, 02:09 PM   #8 (permalink)
The Visitor
 
Raymond18's Avatar
 
Join Date: Jan 2013
Location: Newyork
Posts: 2
Thanks: 0
Raymond18 is on a distinguished road
Default

you should select the proper path of the image which you are going to upload and also see the path is coded on plain text or some code so it will check the reliability of the file which is to be uploaded and how it can be done.Select the file path for upload.
________________________
File Upload
Raymond18 is offline  
Reply With Quote
Old 02-21-2013, 03:07 AM   #9 (permalink)
The Wanderer
 
OldManRiver's Avatar
 
Join Date: Feb 2013
Posts: 7
Thanks: 0
OldManRiver is on a distinguished road
Default

Quote:
Originally Posted by dhaval View Post
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?
DH,

Have a detailed thread on this at:

Object to fix Firefox fullpath issue!

This is not an easy solution as browsers are closing some options in order to meet the "Secure Mode Mandate", now 2 years old and causing real problems to us needing the original information for:

non-hosted web enabled apps

My app is a MySQL Sync app, and can run either hosted or non-hosted (localhost).

I see how they are beating you up, for multiple posts on the same item. I understand as almost no one, except the "real experts" have an answer to this. Be patient, there is code out there that solves this.

I found a JavaScript Object that solved this for .NET, but I can only use it in PHP, so trying to work with some other gurus to get it working in PHP.

Feel free to jump into my thread and track it. We will find the answer shortly.

Cheers!

OMR
OldManRiver 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 07:14 AM
Read Text File in Reverse buildakicker General 9 11-26-2008 06: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 04:30 PM


All times are GMT. The time now is 01:25 AM.

 
     

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