Support » Fixing WordPress » Inconsistent response to file type upload

  • I am trying to allow all standard WordPress filetypes.

    But ignoring Gravity Forms and PODs, WordPress can’t decide whether it will allow files or not.

    I tried uploading 9 files (a mix of .doc and .docx)

    1st time, 8 out of 9 were rejected with “Sorry, this file extension is not permitted for security reasons.”

    2nd time (same 9 files) only 4 were rejected.

    QAR 455-ASD-CERT-Auditor-report-for-EN2907-070.doc
    Sorry, this file type is not permitted for security reasons.
    QER626-ASD-CERT-Auditor-report-for-EN4072-080.doc
    Sorry, this file type is not permitted for security reasons.
    Arconic Alcoa Redditch EN2549-050006F.doc
    Sorry, this file type is not permitted for security reasons.
    Appendix H-Mom KW Nexans Draveil audit ASD-Cert 04-09-18.doc
    Sorry, this file type is not permitted for security reasons.

    What goes on? Random rejects?

    Please help!!

    Brian

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • There is a possibility that the host is restricting your file uploads, so ask the support at your host as well.

    You can also try this :
    https://wordpress.org/plugins/file-upload-types/

    Or add this to your config file :
    define('ALLOW_UNFILTERED_UPLOADS', true);

    If you use this method, and you are not ‘uploading files all the time’ then I would simply add this to your config file, and then comment / uncomment as you need it.

    Thread Starter Brian_Milnes

    (@brian_milnes)

    Thanks Corrina

    The reason for bothering posting here was to highlight that it appears to sometimes work, and sometimes not.(With the same files)

    The “host is restricting your file” uploads doesn’t explain the (frustrating) inconsistency.

    This is day-in day-out requirement, but the wp-config edit does work (further convincing me that it’s not the host).

    How big are the files? I ask because I’ve seen the same behaviour uploading images, and that’s all go to to with the server-side processing that’s done after a file is uploaded. For files like .doc/docx there shouldn’t be much if any, but I’d bet that there’s still processes working to se if it can extract a thumbnail or some other image, and if any of those fail, you’ll see a failure in your uploads. This is all to do with server load, so larger files will cause more issues, but will not cause the same issue every time, and may not cause any at all – all depending on what else the server is trying to do at the same time.

    Thread Starter Brian_Milnes

    (@brian_milnes)

    Thanks catacaustic

    I disagree with your analysis – this is same file set, tested with no other users active. And they are generally small files.
    They also trigger the same specific error on failure ““Sorry, this file extension is not permitted for security reasons.” That is created by the rule that allow_unfiltered_uploads successfully bypasses.

    Can you check the mime types of the files?

    I’ve run into this problem with doc and docx files that when checked return a mime type of application/zip, rather than application/msword or application/vnd.openxmlformats-officedocument.wordprocessingml.document.

    Still doesn’t answer the question of why it sometimes works, though.

    Based on a ticket I found on the core.trac (https://core.trac.wordpress.org/ticket/40175)

    I found this plugin fixed my “Some Office files won’t upload sometimes” problem: https://wordpress.org/plugins/blob-mimes/

    Thread Starter Brian_Milnes

    (@brian_milnes)

    Thanks for this suggestion @silsbyc

    I’ll give this a go and report back

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Inconsistent response to file type upload’ is closed to new replies.