• Resolved ikurti

    (@ikurti)


    The error I receive when uploading a specific file is: “There is something wrong with the file you tried to upload. Try another.” (https://prnt.sc/13nc4as) This doesn’t happen for all the files… Some files that were larger/smaller got uploaded successfully. I also bought the add-on Participant Log (https://xnau.com/product/participant-log/) and the same error occurred. This is the output from the debugging console: https://prnt.sc/13ncghr.

    The image in question can be found here: https://ibb.co/CWzxZB0. I’m not sure if other images might also result in the same issue… If I can be of any further assistance please do let me know.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author xnau webdesign

    (@xnau)

    This one is hard to be specific about. An uploaded file is validated in several ways, but the message you got is what happens if the file can’t be validated, but there is no specific reason given. php is doing the validation, so it’s a little bit of a black box. Reasons this could be considered invalid would be an incorrect file extension (like a png extension on a jpeg image), some kind of flaw with the file headers, or a file that is corrupt. It can be a problem that doesn’t prevent the image from displaying, so it seems like everything is fine.

    Ultimately, it is your server’s php that is validating the file, so it may be due to some reason that is specific to the configuration of your server.

    I’m sorry the answer is so vague, there really is little to go on here.

    Thread Starter ikurti

    (@ikurti)

    Thanks for your reply. Is there anything I can do to narrow the problem down?

    Thread Starter ikurti

    (@ikurti)

    If it helps, I managed to narrow the problem down:

    It only occurs with JPG/JPEG files when uploaded through an iPad. Those same files work fine when uploaded from PC. PNG files also work fine when uploaded from the iPad.

    However, every file seems to work when uploaded to media (even JPG files from iPad) so I am assuming that this issue has to be related to the plugin.

    Plugin Author xnau webdesign

    (@xnau)

    That’s very interesting. It seems likely the WP Media library is using a different method to verify the files when uploaded…Participants Database is relying on php to verify the files, so the plugin is not directly involved in that at all, it just gets a “go/no go” from php.

    Please contact me privately at [email protected], there is something we can try that might help…I don’t want to share it publicly.

    Thread Starter ikurti

    (@ikurti)

    Hey,

    I debugged a bit, added some logs, and went through the plugin code and am happy to report that the issue is identified and fixed!

    The issue was essentially with the file sizes… It seems that the ones on the iPad weren’t working due to coincidence and when I tested the same files I sent them through Facebook Messenger and they must have gotten compressed.

    I set the file limit previously in the plugin settings, but apparently this had no effect (or I misunderstood it’s purpose). I finally found the issue within the code that was getting the wordpress limit and halving it for cushioning the limit (I presume). This code set the MAX_FILE_SIZE limit. The JPG files I was uploading exceeded this limit and none of the PNG files did.

    So to fix, I simply edited this line of code so it doesn’t half the wordpress limit and gives more allowance to the file size. As well as this, I altered the max file size limit settings related to WordPress.

    Maybe the error in the debugger could be a bit better, but who am I to complain :p Thanks for your work. Going to close this and mark as resolved

    • This reply was modified 3 years, 5 months ago by ikurti.
    Plugin Author xnau webdesign

    (@xnau)

    Wow, thanks very much, and it looks like I need to test this so the plugin can give better feedback when the upload fails.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unable to upload file’ is closed to new replies.