PDA

View Full Version : Cannot move attachments to filesystem


Bradley_Wint
05-07-2011, 02:53 AM
Ok guys, I have an NGINX webserver and I am trying to move my attachments from the database to the fileserver. I got the direct path (e.g. /var/www/forums/attachment), CHMODed to 777 but when I tried to move it, none of the files moved. Any ideas?

HMBeaty
05-07-2011, 03:15 AM
What happens when you attempt to move them? Do you get an error? Did you rebuild your counters as directed?

Bradley_Wint
05-07-2011, 03:54 AM
During the move, it asks me to verify the count

1) whether the number match - which they do (5 and 5)
2) Number of Attachments that could not be created or are 0 bytes: 5 ...

So far I have uploaded 5 attachments, which means something is wrong. When I check the attachments folder, I see files in .attach and .thumb format rather than in .jpg, .zip, .gif etc. Finally the URLs are still served via the attachment.php file rather than giving a more straightforward path...which I assume means they have not moved over to the database.

Lynne
05-07-2011, 04:05 AM
The attachments are supposed to be in .attach format and they will still have the attachment.php file serving them since that file makes sure only users who have permissions to see the images can see them.

Bradley_Wint
05-07-2011, 04:16 AM
The attachments are supposed to be in .attach format and they will still have the attachment.php file serving them since that file makes sure only users who have permissions to see the images can see them.

So I shouldn't be too worried about the 2nd line not being 0?

Lynne
05-07-2011, 04:11 PM
Take a backup, move the attachments, see if they moved and everything works (make sure to do a hard refresh on pages you have visited before to get the files served up correctly). If everything is fine, then great. If it isn't, then import your backup.

I really don't know anything about nginx. You tried this once, right? Did you look in your error_logs (if you don't know where they are, ask your host) to see if there was an entry there?

RobDog888
05-08-2011, 04:47 PM
To add to Lynne's comment, the .attach and .thumb files are when then database exports the attachments to the file system. When it does they become files with those extensions. If they were still in the database then you will NOT see any files since they are stored in the db ;)