Permission denied on file uploads

Discussion in 'General' started by autonic, Jun 22, 2007.

  1. autonic

    autonic New Member

    Hi, ive got a strange problem with my ispconfig.

    I've just installed and configured the system and everything seems to be working. I've got a blog page on one account with an image upload script.
    The script does what it's told and I can upload images and publish them on my blog.

    But then I got another site (a mp3 project of mine) and there the upload just wont work no matter what filetype or size I use.

    The upload code (just so you will know that there is no error in the script)
    <form method="post" action="index.php?a=upload" enctype="multipart/form-data">
    <input type="file" name="mp3"><br>
    <input type="submit" value="Upload" class="button">
    if ($_GET['a'] == "upload")
    	if ($_FILES['mp3']['tmp_name'])
    		$file		= $_FILES['mp3']['tmp_name'];
    		$filedir	= '/files';
    		copy($file, $filedir);
    On upload I always get this error no matter what file or size I try to upload:
    (Ive tried both mp3files and images of various sizes)

    I've cheked and rechecked the folder attributes so that they are correct and tried to compare the two scripts (my working blog image upload, and this new mp3 upload) to find anything that separates them from each other but I just dont get it...

    Does anyone have any idea on what could be causing this?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you want to copy the file to a subdirectory named files of the website and not to /files which would be a directory right under the servers root directoyr which is of course not permitted.

    So if you use:

    $filedir = 'files'


    $filedir = '../files'

    if the directory "files" has the absolute path /var/www/web14/files, it should work.
  3. autonic

    autonic New Member

    ok, thanks :)

    I've got another question thou.... where do I change the max upload size in ispconfig? (or do I have to edit manually in php.ini?)

    I guess the default isn't that high...
  4. falko

    falko Super Moderator ISPConfig Developer

    You have to change that in php.ini and restart Apache.

Share This Page