Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Upload file via FTP

  1. #1
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Upload file via FTP

    It´s possible upload a file in PHP via FTP??

  2. #2
    Join Date
    May 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If you mean is it possible to upload a file with a .php extension then yes it is

  3. #3
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm sorry I don´t mean that!!

    But upload a file with .pdf or .jpg extension for a DB when you have a field with the type file

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You wish to use PHP to upload a file to a server via FTP?
    You can do this. Have a look at http://www.php.net/ftp
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    May 2005
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oops....must have miss interpreted your question paramoxo

  6. #6
    Join Date
    Jul 2005
    Location
    UK
    Posts
    159
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    You wish to use PHP to upload a file to a server via FTP?
    You can do this. Have a look at http://www.php.net/ftp
    wow thanks for the link, i've been looking for the same thing a while

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Note that there are easier ways to do this if its the same server the php is running from. You can open/modify/save files from the local server.
    FTP is only needed if you're working with more than one.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Apr 2006
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Isn't more safe to do a upload via ftp that via http? Give me some advantages and disadvantages by uploading a file with this form to decide better...

    One more question. Can I do an update query for change a file?

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Isn't more safe to do a upload via ftp that via http? Give me some advantages and disadvantages by uploading a file with this form to decide better...
    There are neither equivalent advantages nor disadvantages to the two methods. FTP is easier to use for a remote server, is all, because HTTP requires you to construct the request by hand in PHP. If you're looking for security, PHP (with appropriate modules and compilation options) can upload a file via SSH, which is encrypted and therefore considerably more secure.
    One more question. Can I do an update query for change a file?
    No, you must download it, edit it, delete the original, then upload your copy in its place.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Not neccessarily... you can modify files that are on the server through php, but it is hard to do so, depending on complexity. You'd never want to do more than a text file like that.
    Now... it wouldn't be updating... it would be creating a new one and replacing, but all in PHP.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •