Jump to content


Photo

Problems uploading images or files


  • Please log in to reply
14 replies to this topic

#1 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 01:41 AM

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

#2 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,586 posts
  • 906

  • LocationVihti, Finland

Posted 16 August 2011 - 03:24 AM

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).

#3 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 03:37 AM

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.



#4 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 16 August 2011 - 03:43 AM

This command from the shell should fix it:

chmod -R ugo+rw site/assets

Type that from your web root dir.

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 16 August 2011 - 03:53 AM

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.

#6 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 03:56 AM

Ryan,

That command did not solve my issue.



Sylvio

#7 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 04:02 AM

Could the issue be that PHP safe_mode is on?

#8 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 16 August 2011 - 06:39 AM

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.

#9 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 16 August 2011 - 06:54 AM

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.

#10 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 07:06 AM

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

#11 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 16 August 2011 - 07:12 AM

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.

#12 Sylvio

Sylvio

    Full Member

  • Members
  • PipPipPip
  • 51 posts
  • 5

  • LocationBelgium

Posted 16 August 2011 - 07:18 AM

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

#13 beto

beto

    Newbie

  • Members
  • Pip
  • 7 posts
  • 5

  • LocationCozumel, Mexico

Posted 26 April 2012 - 12:24 AM

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?

#14 formmailer

formmailer

    Sr. Member

  • Members
  • PipPipPipPip
  • 245 posts
  • 29

  • LocationHudiksvall, Sweden (but originally from The Netherlands)

Posted 26 April 2012 - 12:30 AM

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

#15 ryan

ryan

    Hero Member

  • Administrators
  • 5,985 posts
  • 3386

  • LocationAtlanta, GA

Posted 26 April 2012 - 03:55 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users