Jump to content
Sylvio

Problems uploading images or files

Recommended Posts

Hi,

So I am facing this issue, I just moved my clients website on to his (pre-live) hosting but I'm having issues uploading images and files, actually any upload thru processwire admin fails (http upload).

I am getting this error:

Unable to move uploaded file to: /var/www/vhosts/showled.tv/httpdocs/site/assets/files/5874/20110707_164442-1.jpg

The hosting is a linux server with a Plesk system, and I think the problem is that every upload thru http is done by the user apache:apache, and there lies the problem!

This is pretty urgent, the client started to add content, but he is not able to upload his images, etc...

Is there anybody who can help me this issue?

Regards,

Sylvio

Share this post


Link to post
Share on other sites

Files are written to /site/assets/files/ so make sure you have given write permissions there (0777 if using (s)ftp or chmod ugo+rw if using shell).

Share this post


Link to post
Share on other sites

All write permissions are correct 777 to /site/assets/files/, a temp directory is created, for instance '5874', with 777 permissions, BUT the file is not moved to this location.

Share this post


Link to post
Share on other sites

This command from the shell should fix it:

chmod -R ugo+rw site/assets

Type that from your web root dir.

Share this post


Link to post
Share on other sites

5874 is not a temp dir. That page id numbered dir is created for every page as its place to store files. Running as apache:apache is totally normal, just have to figure out where the file system is blocking write access to apache. Could also be that one of the parent dirs needs +x.

Share this post


Link to post
Share on other sites

That could definIty be an issue. I recommend disabling that first thing. Also, another good way to identify problems is to install a fresh copy of PW through the installer.

Share this post


Link to post
Share on other sites

Try adding this to the top of your .htaccess:

php_value upload_tmp_dir  /path/to/root/site/assets/cache/

Of course replace with the actual path to site/assets/cache/. This may allow you to work around safe mode.

Share this post


Link to post
Share on other sites

Turning safe_mode off solved my issue!!

I will also try the 'upload_tmp_dir' directive change instead

Thanks for all your help, my client thanks you

Cheers

Sylvio

Share this post


Link to post
Share on other sites

Glad that worked. If you can , keep it turned off. I was only suggesting to change the upload dir if you couldnt turn off safe mode. There is a reason why PHP 6 doesn't even have safe mode, it's generally a bad thing when you are trying to run any kind of web application. I don't know of any web hosting providers using safe mode.

Share this post


Link to post
Share on other sites

I thought that the client had disabled it, they have like a full admin plesk hosting where the provider doesn't configure anything, so I guess the client missed this setting :D

Share this post


Link to post
Share on other sites

Hello, I am new to this intriguing dimension called ProcessWire.

I am doing my first steps, but I also get this message:

Unable to move uploaded file to: /var/www/vhosts/showled.tv/httpdocs/site/assets/files/5874/20110707_164442-1.jpg

I am running the site in Windows-Apache-PHP5.3

Any help?

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

Did you check the permissions on the assets folder?

I am not so familiar with Apache on Windows, but assume that the service account running Apache needs write permission to the assets folder, as well as to it's subfolders.

/Jasper

  • Like 1

Share this post


Link to post
Share on other sites

Jasper is right: it sounds like PHP/Apache doesn't have write access in your /site/assets/ dir.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...