Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Cannot add images when 'multiple images per item' is checked #50

Open
KoenHeye opened this issue Feb 27, 2014 · 5 comments
Open

Cannot add images when 'multiple images per item' is checked #50

KoenHeye opened this issue Feb 27, 2014 · 5 comments

Comments

@KoenHeye
Copy link
Contributor

For testing purposes, I created a basic module with 2 fields (title and description) and checked 'multiple images per item' before generating the module.

I then installed the module on a clean Fork CMS 3.6.6 installation and tried adding an item with image.
Unfortunately the image doesn't seem to get uploaded at all. The page shows a javascript error:

[FineUploader] Error when attempting to parse xhr response text (SyntaxError: Unexpected token <) util.js:146
qq.log util.js:146
qq.FineUploaderBasic.log uploader.basic.js:120
qq.UploadHandler.log uploader.basic.js:254
parseResponse handler.xhr.js:215
onComplete handler.xhr.js:259
(anonymous function) handler.xhr.js:293

Ajax call that gets triggered: POST /backend/ajax.php?fork%5Bmodule%5D=basic_module&fork%5Baction%5D=upload&qqpartindex=0&qqpartbyteoffset=0&qqchunksize=637&qqtotalparts=1&qqtotalfilesize=637&qqfilename=secondarytile.png&qquuid=205660c6-700d-4363-b8ea-6f4aae19826b&qqfile=secondarytile.png HTTP/1.1

Note: In a module with a separate image field, the upload works. But I really need multiple images!

@WouterSioen
Copy link
Owner

Can you add the response of the ajax upload? In Google Chrome, you can find it by going to your network tab, and adding an image. A new entry should appear. If you click on it, you can choose too watch the response. This could help me a lot in debugging the source of the issue.

@KoenHeye
Copy link
Contributor Author

Complete response: https://gist.github.com/KoenHeye/2f2b8e79b937d7b6aec6

A SpoonThumbnailException occurs
Trace: File C:\wamp\www\modulemaker366/backend\modules\basic_module\ajax\upload.php
Line 89
Class SpoonThumbnail
Function __construct
Argument(s)
array (size=3)
0 => string 'C:\wamp\www\modulemaker366\app/../frontend/files/basic_module/uploaded_images/source/1393537440851_57fbcfd3a4bbac8e44e2331aa63ab0e4.png' (length=135)
1 => int 100
2 => int 100

@WouterSioen
Copy link
Owner

Thx, I'll look at it this weekend.

@WouterSioen
Copy link
Owner

@KoenHeye I can't reproduce this on my machine. Is the image you sent smaller then 100x100 pixels?

It could also be a Windows issue. Have you ever had trouble with SpoonThumbnail on a Windows machine?

@KoenHeye
Copy link
Contributor Author

Hello @WouterSioen, I just found some time to do more tests. So my apologies for the late response.
Images are not smaller than 100x100px. It will definitely be a Windows issue (I haven't used SpoonThumbnail before).

The response mentioned previously, was for a file of 40kb. When uploading a larger file (> 1MB), I got the response: {"error":"Server error. Uploads directory isn't writable or executable.","num":6,"index":0}

I checked out possible access restrictions on the uploads directory frontend\files\basic_module but everything looked ok.

I noticed that the error gets generated in qqFileUploader.php (library\external\qqFileUploader.php).
The method is_writable($uploadDirectory) and is_writable($chunksFolder) are used. But it seems that that method is unreliable in Windows environments: http://stackoverflow.com/questions/15888673/fine-uploader-implementation

Perhaps use another version for the qqFileUploader.php: https://github.com/Widen/fine-uploader-server/blob/master/php/traditional/handler.php
Check out the comment of the method isInaccessible.

I'll test this out in my Windows environment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants