SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: fput or ftp?

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2000
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!
    I am making a guestbook using php/MySQL and Apache 1.3.19 in Linux
    The users will be able to upload a picture and this is where my problem is. I used ftp to upload the images when my server was on a Win2K machine. Now that I'm using Linux, what is the best solution?
    //Magnus

  2. #2
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm not quite sure what you mean, but you can write a php script that allows the users to upload files. The files are uploaded by their browser from a form (using a POST action).

    That's what happens here in the sitepointforums. In fact in these forums I think the avatars are saved as blobs in a database table.

    You could either stick the images into a database (which is complex - I've never done it yet) or have them placed as files in a specific directory.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The manual has a good explaination of how to do this:
    http://www.php.net/manual/en/features.file-upload.php

    One thing, put the following into a script and run it from your server
    <?php phpinfo() ?>

    Check to see whether safe mode is ON or OFF. If safe mode is on, that's a bit of a pain because you can't access the file system outside your document_root, and the uploaded files are stored in /tmp directory. Check with your ISP about what to do. I tried to fiddle with a .hraccess file to set the file upload directory in my doc_root path, but no luck. I ended up having to run the script as a CGI.


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
  •