SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru TacMaf's Avatar
    Join Date
    Dec 2005
    Location
    Manchester, United Kingdom
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP uploads of sensitive files

    Hi,

    I was wondering what the best option would be for uploading sensitive files (with client info). Could PHP upload them outside the htdocs public area? If so, how could they then be downloaded?

    Cheers,
    Rhys

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The way that uploads work is that the files are immediately stored in a tmp directory on the server. It is up to you to then move them to somewhere useful - that can be outside of the htdocs directories if you wish.

    A prerequisite for doing any file uploading work is to spend a good amount of time studying the various parts of the manual - which I find is one of the best written subjects.

    It might be a pain - but uploading files is chock full of gotchas - there is no shortcut to reading the manual on this particular subject.

    http://php.net/manual/en/features.file-upload.php

    See especially the "Common pitfalls" section.

  3. #3
    SitePoint Guru TacMaf's Avatar
    Join Date
    Dec 2005
    Location
    Manchester, United Kingdom
    Posts
    663
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Uploading tends to be OK but I usually upload them to a live directory. I wasn't sure if they could be uploaded outside of htdocs, but now I know. I've had them upload outside htdocs and used a php file to force a download, after the usual check to see if they are logged in. First time I've done that. I spotted the problem on a system built by my predecessor. All fixed before launch luckily so no harm done.

    Cheers,
    Rhys


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
  •