Default Upload Directory

  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

what's the default upload directory for php on a linux server?

say you have a form set up to let the user upload a file, where is the default
loacation on the server?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9092
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I am not exactly sure where it is stored... I am guessing maybe by default it is stored in /tmp -- I am not positive though. You can use something like below to move it to a designated upload directory that you specify.

$name = "filename.txt"; //or filename.jpg or whatever
$uploadPath = "/path/to/some/directory/";
$tmp = $HTTP_POST_FILES['formFieldName']['tmp_name'];
move_uploaded_file($tmp, $uploadPath . $name);

I believe the above will work. I am not totally familiar with PHP, but know some things.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

thanks bigweb, I'll give the a whirl. :)
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

ok, the actual problem was with the size of the files. So, on the server, there's a
file /etc/php.ini, and there is a line in it that says max_upload_filesize=2M.

Simply edit the file size. :D

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 119 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.