Jump to content

Image uploads disappearing on save

Recommended Posts

 When i'm uploading multiple Images in backend everything looks fine first.

- All Images are uploading

- All Images are shown as Thumbnails 

but after saving, about 50% of the images are gone. For Example: I upload 10 images, every image is shown in the form, but after saving i have just 5 or 6 images assigned.

I don't get any errors, not in Developer Console, not in PW logs, no PHP Errors

If i drag and drop them one after on the upload area (same files) and wait until thumbnail is shown and then save the form, everything works fine.

If i try the same form local on a XAMPP installation, everything works fine.

Any idea ?

  • Like 1

Share this post

Link to post
Share on other sites

I had the same problem a few days ago when I tried to add 40 highres images in one go. On localhost. There were only like 3 images in the assets folder, rest didn't make it, except into the db.

I mixed things up pretty bad, sorry. Had that installation still lying around and refreshed my memory: I had a problem with images, but not nearly close to this one (was about generating lots and lots of thumbnails).

Share this post

Link to post
Share on other sites

I can confirm a behave like @NoremPload describes, but not like @tsdtsdtsd said. This must be different things.

I have noticed this two times by myself:

 1) on a PW 2.3.5 site, a year ago or so. Here it has gone away without any interaction. (??) weird!

 2) on a local installation of a friend, where it occured from time to time. But couldn't detect any reason why it behaves that way.

All images were stored in the assets files subfolder and all admin thumbnail variations were successfully created. After a page reload, with or without using the save button, some images were gone from the images field. (not written into DB)

And without allowing to overwriting existing images on upload in the field edit page, you are not able to upload them again! (Error about image files are already exists, but may belong to another field of that page!)

Only thought is, that it (must) have to do with the MySQL DB and the lot of concurrent save requests for the pages image field! But I'm not very familiar with DB stuff.

So, as it is also a bit weird that an optional wanted sort order gets distorted by a multiple asynchronus upload I always use zip upload nowadays. You can enable zip upload to image fields. This way only one file gets uploaded, and than one by one image gets extracted, registered and variation created. No concurrent tasks anymore. Also an optional wanted alphabetical sortorder is kept. :)

As this only is a workaround, the asynchronous concurrent images upload should work too. And it does work for maybe 99,9995 percent. But if you run into that 0,0005 percent, it is weird.

If you like, you can open an issue on github. If not, I will do so later. Am on the go now. :)

BTW: @NoremPload, your avatar reminds me of an old friend of mine. :lol:

Edited by horst

Share this post

Link to post
Share on other sites

hi again,

Thx for your detailed reply! I tried the zip upload, it also does not work 100%. Uploading a 40MB Zip File works, but everything over about 150MB failes, i have 250 MB max_filesize and 250 memory_limit, maybe that's not enough and the error i get doesn't help => Uncaught TypeError: Cannot read property 'error' of null(anonymous function) @ InputfieldFile.min.js?v=118:1

I bulid workaround upload page where i upload the zip, unpack it and add the images via API. 

  • Like 1

Share this post

Link to post
Share on other sites

I just experienced this issue for myself today. I tried uploading 10 images, and it will only "Save" 5 of them. It also seems like it isnt saving them in the order of upload (it appears to be pretty random).

Share this post

Link to post
Share on other sites

The order of files is determined by the order of finishing the upload and not the order of input. 

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.

  • Similar Content

    • By Mats
      BETA: SplashAndGrab
      This module attaches a search input to selected image fields that lets you search and download images from Unsplash.
      (Unsplash is a stock photo service where you can download images for free and use as you wish. No strings attached.)   
      You can search by string, colors, orientation/crop and order by relevance or time published
      I find Unsplash useful both for placeholder images when building sites but also as a time saver for editors if they don’t have any images at hand, just search, download and publish.

      Thanks to @apeisa for building the  FlickrInputField Module and @Robin S for AddImageUrls,  took a lot ideas and code from those modules.
    • By Markus (Blue Tomato)
      We have created a module to create BlurHash strings for images while uploading in ProcessWire. This blurry images will be saved in the database because they are very small (20-30 characters) and can be used for Data-URL's  as placeholders for image-lazy loading.
      E.g. where we use this in production:
      https://www.blue-tomato.com/en-INT/blue-world/ https://www.blue-tomato.com/en-INT/blue-world/products/girls-are-awesome/ https://www.blue-tomato.com/en-INT/buyers-guides/skateboard/skateboard-decks/ https://www.blue-tomato.com/en-INT/team/anna-gasser/
    • By EyeDentify
      Hello dear PW gurus.

      I have stumbled over a strange error that i all of sudden got when trying to upload an image to a images field on a page.
      There where images allready stored in the field that i wanted to keep, but during the upload the error apear and after that all images are gone from the field and i can´t upload any, i just get the error every time.
      I am running ProcessWire 3.0.153 dev.
      After looking in the assets folder i find the folder for the page and the image files seems to be there including the ones i tried to upload when the error occured.
      But they don´t show up in the images field in the page editor.
      The error reported:
      SQLSTATE[01000]: Warning: 1265 Data truncated for column 'ratio' at row 1 And here is a screenshot of the event:

      The TracyDebugger Error reporting:

      I hope you fine folks could point me in a direction.
      But it seems our old pal set_time_limit() is back.

      Regards, EyeDentify
    • By rushy
      Hi all
      Continuing my first project where I am creating and manipulating stuff from the frontend. Till now I've always added things like images from the backend, but in this project I need to add and move images from a frontend control. This is a photo album where images are stored in albums, each album being a page containing a Pageimages array in the usual way. So what I want to know is how do I move an image from one album (page) to another in the frontend? I just need some guidance on how to approach this.  I suppose I need to do a copy and delete - but how do I copy an image or images from one page to another? What function should I use to create a new image on an existing page? I include a code snippet from the server side of my delete image request and it works fine. I'd like to implement something similar for a move and upload new image request. 
      Many thanks for any help. Paul 
      <?php namespace ProcessWire; // sanitize inputs as 1-line text $action = $sanitizer->text($input->post('action')); $instr = $sanitizer->text($input->post('input')); $sel = $input->post('selected'); // Expect JSON for image selected image list $selected = json_decode($sel); $nosel = count($selected); $response = array(); // for building JSON response switch($action) { // delete selected images case 'delete': $out = "<p>Deleted $nosel image(s)</p>"; foreach($selected as $item){ $album = $pages->get($item->album); $album->of(false); $out .= "<p>Image {$item->file} from album {$album->title}</p>"; $album->images->delete($item->file); $album->of(true); } $out .= saveUpdatedAlbums($pages, $selected); // add the response message for the delete $response['message'] = $out; break; ...... // save any album that had an image deleted function saveUpdatedAlbums($pages, $selected) { $cur = ''; $out = ''; foreach($selected as $item){ $album = $pages->get($item->album); if($album->id != $cur) { $album->of(false); $album->save('images'); $album->of(true); $cur = $album->id; $out .= "<p>Updated album {$pages->get($cur)->title}</p>"; } } return $out; }  
  • Create New...