SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: file upload

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    file upload

    I have this code to take care of my files I upload on my server. But sometimes files get skipped and won't upload. How can I in that case retry the script to give the file a new shot?
    PHP Code:
    move_uploaded_file($_FILES['Filedata']['tmp_name'], "../media/uploads/"$myVariable".jpg"); 

  2. #2
    SitePoint Zealot
    Join Date
    Feb 2005
    Location
    Aveiro, Portugal
    Posts
    164
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Can you explain why some files get skipped?

    Does your function return some success or failure message?

    Maybe it should. In that case you could retry uploading.
    Yours truely
    Mário Ramos

  3. #3
    SitePoint Addict Phidev's Avatar
    Join Date
    Oct 2008
    Location
    Texas
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if(!move_uploaded_file($_FILES['Filedata']['tmp_name'], "../media/uploads/". $myVariable. ".jpg"))
    {
    //retry
    }


Bookmarks

Posting Permissions

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