dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to retrive uploaded files using php

  1. #1
    Join Date
    Dec 2013
    Posts
    12

    How to retrive uploaded files using php

    Hello Php Gurus

    I am still finding my way around php.

    i need to retrieve a file uploaded to my server with its path linked to a database.I am seeing every other thing except for the file uploader by that user.please can someone show me how to put the code for the link on this file for a user to show on the html output?Thank you this is the array


    @$upload_Name = $_FILES['FILE']['name'];
    @$upload_Size = $_FILES['FILE']['size'];
    @$upload_Temp = $_FILES['FILE']['tmp_name'];
    @$upload_Mime_Type = $_FILES['FILE']['type'];

    @move_uploaded_file( $upload_Temp , $uploadFile);
    chmod($uploadFile, 0644);
    $upload_URL = "uploads/".$upload_Name ;
    $id=$_POST['id'];
    $name=$_POST['name'];
    $from=$_POST['from'];
    $gender=$_POST['gender'];
    $address=$_POST['address'];
    $upload_Name=($_FILES['FILE']['name']);
    //Writes the information to the database
    mysql_connect("localhost", "p_o", "hello") or die(mysql_error());
    mysql_select_db("p_profile") or die(mysql_error());
    mysql_query("INSERT INTO `users_cv` VALUES ('$id', '$name', '$from', '$gender', '$address', '$upload_Name')");

  2. #2
    Join Date
    Dec 2013
    Posts
    5
    Quote Originally Posted by sperox View Post
    I am seeing every other thing except for the file uploader by that user.
    Is it the file-uploader (i.e username) or the file that was uploaded?

  3. #3
    Join Date
    Dec 2013
    Posts
    12
    Hi
    The file that was uploaded

  4. #4
    Join Date
    Dec 2013
    Posts
    5
    Everything works except the file isn't uploaded, is that correct?
    To me it looks like something is missing, but you may have that somewhere in your code (unless this is all)
    (I am also fairly green on this, I have only been working with PHP for a bit more than a year)

    Is there a chance I can see the entire code for this submit form?

  5. #5
    Join Date
    Dec 2013
    Posts
    5
    This may be useful for you, a thread for image upload.
    Should be easy to adjust to a file upload, or use it as reference

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