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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By Andreas Augustin
      Hello!
      Can I deactivate the renaming feature of images and the editing (croping, rotating etc) in the processwire admin panel?
       
    • By dragan
      I was thinking about writing a module: Enabling PW to index and search contents of uploaded files.
      I know the easiest way to include search-inside-files capability is to use Google CSE. Developers who have a dedicated server may of course use of of the "big boys" of search like Lucene, ElasticSearch, Solr etc. For ES you'll need Apache Tomcat, which most people don't have at their disposal, etc.
      So, my question is, first of all: Would such a feature be used at all? I know you can create some sort of meta-search with file-descriptions, or when using the "one page per file" approach.
      After some brainstorming, I came up with this:
      Idea:
      Make it possible to search file upload content (PDFs, Word, Excel)

      Approach:
      Build a module (d'oh)

      Config settings:
      select templates / file-fields (what to index) - list all inputfields type "file"
      “index now” button or “index each time a file is added” or cron? Performance?
       
      Where / how to store indexes?
      As a separate, new field inside each page? On the file-system? In the module folder, each file has a related JSON file? (similar to language files) A new, separate DB-table?
      What we need:
      filename / path / URL filetype (to customize search results with file-icons) page id extracted content timestamp of last index-build? MD5/SHA hash or some such? How to handle user roles when doing actual search? Inherit from page? Inherit from file-field?
       
       
       
      So, what do you think? Not worth it? Does something like this already exist (I searched, but found nothing)?
       
    • By statestreet
      We have an internal company site that we use to document specifications for software development. Currently, we use Adrian's ProtectedMode module to restrict the site to logged-in users, but one of the engineers just noted that uploaded files are (naturally, given the scope of the module) visible without authentication. While this isn't a huge risk (you have to know the URL to view an uploaded file), it is technically a security issue since we have lots of proprietary things attached to pages on the site.
      Any ideas on how I could lock down these files so you have to be logged in to view them? 
    • By statestreet
      On the site for a game development collective I'm part of, I've been trying to add the ability for our developers to attach game builds from Unity (a 3D game engine and development environment) to blog posts. Unity cranks out an HTML file with everything ready to go for static hosting, so I've simply added a file field in the blog post template that accepts the four files Unity exports, one of which is jquery.min.js.
      Obviously, this is highly redundant, having the content author upload another copy of jQuery with each build, but it's actually a more streamlined workflow than the alternative of building a standard Unity player template, which would then require the author to create an additional page in ProcessWire each time to attach the Unity file.
      So I've gone with this redundant but easy approach. However, I've run into a technical snag: Even after explicitly allowing "min.js" files for the field, the file uploader always renames the jQuery file to "jquery_min.js", which is then not found by the HTML file looking for the original name. Is there a way to disable this behavior?
    • By dragan
      I have cloned (duplicated) a few file input fields today, but found the following odd behaviour:
      - Drag'n'drop is no longer possible.
      - Trash icon doesn't display in Mac/Safari + Mac/Chrome.
      - I can't delete any uploaded files anymore.
      addtl. infos:
      Filetypes are usual stuff / allowed file-types (PDF mostly) etc.
      PW 2.3.2 dev
      Files are visible in the backend and in the DB.
      Tried on Mac Safari + Win Google Chrome (in the latter, the trash icon is fine)
      Due to a large number of input fields, we've resized the input field width to 50 or 25%, but changing them back to 100% didn't do anything.
×
×
  • Create New...