Jump to content

When uploads get stuck on 100% and manual addition doesn't work


hellomoto
 Share

Recommended Posts

Sometimes my file uploads get stuck on 100% and do not complete, even if I try with a zipped version. So then I try adding the file to the page files directory and inserting a new record in the field's table. Sometimes this works, sometimes not. When it doesn't, what to do? Is there a way to add the db record via API that'll register in the page? The existence of the record itself should present, I don't understand.

Link to comment
Share on other sites

You can use API to import files into your Pagefile fields. Here's the relevant bit from docs

<?php
// Adding new file(s)
$page->files->add('/path/to/file.pdf'); 
$page->files->add('http://domain.com/photo.png'); 
$page->save('files');

I had a similar problem as yours where images uploads would get stuck. After I upgraded from v2.7 to v3.0, it went away. Also check your max POST request size limits on for PHP and your server. Inside php.ini you should see max_post_size setting, try increasing it. Check your permissions to /site/assets/ directory. Here are the recommended settings

 

# Change the permission of ALL directories (recursively)
# Replace site/assets with the name of the starting directory you want to change, and replace 755 with the permission you want to use.
find site/assets -type d -exec chmod 755 {} \;

# Change the permission of ALL files (recursively)
# Replace site/assets/ with the name of the directory where files are located, and replace 644 with the permission you want to use.
find site/assets/ -type f -exec chmod 644 {} \;
 
  • Like 1
Link to comment
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
 Share

×
×
  • Create New...