www.webdeveloper.com
Results 1 to 3 of 3

Thread: get "value" of file upload field

  1. #1
    Join Date
    May 2011
    Posts
    19

    get "value" of file upload field

    I have a file upload field in my update form.

    How do I get the value of what was put in the field (the file path), so that it can be re-inserted into the file field via php?

  2. #2
    Join Date
    May 2011
    Posts
    19
    i used this code at insert form





    PHP Code:
    $rfile =   basename$_FILES['file']['name']) ;
    $target_path "files/";
    $target_path $target_path basename$_FILES['file']['name']);
     if(
    move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { 
    echo 
    "upload success";} 
    else{ 
    echo 
    "error";} 

    How to be in update form

  3. #3
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    You can't preset the client's source path. What you CAN do, if the file has already been uploaded, is replace the file input with placeholder text to indicate that the file was uploaded on the previous form submission.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles