SitePoint Sponsor

User Tag List

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

    FTP upload vs. POST upload

    I'm trying to upload big files to my ftp. I know my webhost has a max upload limit on 20MB, but that's why I'm trying to upload using ftp instead of the regular one here first. Can someone explain why I don't seem to be able to upload big files with the ftp code, I was under the impression it had no limit on ftp uploads.. or am I missing something?

    The regular code:
    PHP Code:
    move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
    chmod("./files/".$_FILES['Filedata']['name'], 0777); 
    Ftp code:
    PHP Code:
    $conn_id ftp_connect("ftp.myserver.com"); 

    $login_result ftp_login($conn_id"user""pass"); 

    $source_file $selectedFile;
    $destination_file $myFileName;

    $upload ftp_put($conn_id$destination_file$source_fileFTP_BINARY);

    ftp_close($conn_id); 

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    ftp_put uploads a local file (one that's on your server) to the destination FTP server. That doesn't help you get the large file from the client to your server.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, Is there another function that enables me to use a file that's NOT local then?

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lammspillning View Post
    Ok, Is there another function that enables me to use a file that's NOT local then?
    No, your server side code cannot interact with the client's hard drive, so there can't be a PHP function to get around a file upload limit set by the host. The client has to upload the file to the server before PHP can do anything with it.

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    NOOOOOOOOO!!!!!
    hehe I'm never going to solve this then

  6. #6
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How big of file is it?

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well it's not specified, but I want user to be able to upload movies and stuff on my ftp, so about 20-300MB

  8. #8
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Perhaps you could find a user-friendly Java applet for uploading to your FTP server.

    http://www.hotscripts.com/category/j...le-management/

  9. #9
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to look into developing or finding a Java solution that will chunk a file (on the client's side) in order to upload it.

  10. #10
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm yeah I could look into it, but I'm building a full flash based site, so that may not work for me..

  11. #11
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lammspillning View Post
    hmm yeah I could look into it, but I'm building a full flash based site, so that may not work for me..
    You can write an FTP client with Flash using sockets... I know there's socket interfaces in Flex...

  12. #12
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ooh.. that sound interesting! I will look into that then
    Thanks alot for the help!

  13. #13
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But can flash read the filesystem? I thought it couldn't.

  14. #14
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by crmalibu View Post
    But can flash read the filesystem? I thought it couldn't.
    It can. I'm sure that implies some kind of security consideration (I've seen Flash pop up a security box asking me permission to access things on my system before) but I don't know how that works.

  15. #15
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've used JumpLoader Java applet which provides partitioned uploads, resume broken uploads and many other features. It's free, unless you want to remove the subtle display of its logo.


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
  •