WordPress.org

Ready to get started?Download WordPress

Forums

Frontend Uploader
[resolved] Error When Uploading PDF (22 posts)

  1. TKPM
    Member
    Posted 1 year ago #

    Hi, I'm receiving the following error code when trying to upload pdf files:

    Warning: in_array() expects parameter 2 to be array, null given in /home/content/24/10812624/html/wp-content/plugins/frontend-uploader/frontend-uploader.php on line 198

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/24/10812624/html/wp-content/plugins/frontend-uploader/frontend-uploader.php:198) in /home/content/24/10812624/html/wp-includes/pluggable.php on line 876

    http://wordpress.org/extend/plugins/frontend-uploader/

  2. TKPM
    Member
    Posted 1 year ago #

    Sorry, forgot to mention I'm using Firefox 19.0.2

  3. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    What version of Frontend Uploader do you use?

  4. TKPM
    Member
    Posted 1 year ago #

    I'm on Version 0.5.

  5. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Hey I found the cause of this, Please download v0.5.1 that should take care of it:
    http://wordpress.org/extend/plugins/frontend-uploader/

  6. TKPM
    Member
    Posted 1 year ago #

    Great, thanks for the quick update!

    The only other error is now when I try to upload the pdf, it says it's not an allowed file type, even though I have .pdf checked under the Settings. Do also need to notate it under allowed categories?

  7. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    No it should work as is,

    However, with mime-types it sometimes can be difficult. Can you try to upload and doc or docx files and see if they go through?

  8. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Also, check the faq section, there's some explanation why this might happen

  9. TKPM
    Member
    Posted 1 year ago #

    I received the same error for the doc file. I'll also check the faq section in the meantime.

  10. TKPM
    Member
    Posted 1 year ago #

    As a test, I also tried a psd file and received the same error. Also, when I tried updating the functions.php (using the Twenty Twelve theme) with the code from the faq, I received the following error:

    Parse error: syntax error, unexpected T_STRING in /home/content/24/10812624/html/wp-content/themes/twentytwelve/functions.php on line 455

  11. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Oh example is missing trailing semicolon

    add_filter( 'fu_is_debug', '__return_true' );

    Try this and see what mime-type is causing troubles. Are you trying it locally or on the server?

  12. TKPM
    Member
    Posted 1 year ago #

    Ok, I entered that from the Network Admin Dashboard. Odd thing is, whether or not I add a semicolon at the end, I still receive the syntax error. My apologies in advance, I'm not too familiar with php!

  13. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    No worries!

    Hmm, the corrected version is perfectly valid and should not produce parse errors. Can you post the surrounding lines of where you pasted it?

  14. TKPM
    Member
    Posted 1 year ago #

    I pasted it at the very end of functions.php, right after

    add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );

    Just tested another pdf and no dice.

    Now here's the crazy thing- whenever I try going into the site dashboard, even after I removed and reinstalled the Twenty Twelve theme, I keep getting that Parse error.

  15. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    That's weird. It should either break everywhere (like it happened to you when you first trying pasting that line) or work everywhere. Try to delete the folder with twentytwelve and re-upload again.

  16. TKPM
    Member
    Posted 1 year ago #

    Ok, I deleted the folder, re-uploaded, cleared cache on browser, logged out and logged back in, still getting error when trying to open site dashboard (I'm on a WPMU setup by the way). However, if I visit the site and click on Edit, I can still get into the dashboard from there, just not from the "Dashboard" link itself.

    In regards to receiving errors when trying to upload the pdf and psd files, is there any other code (or a better place in functions.php) I should enter aside from

    add_filter( 'fu_allowed_mime_types', 'my_fu_allowed_mime_types' );

    ?

  17. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    You should figure out what mime type is your PDF file (that's what fu_is_debug filter for) - it'll display more detailed information on failed upload (including mime-type),
    and then add this mime with
    add_filter( 'fu_allowed_mime_types', 'my_fu_allowed_mime_types' );

    If you post here what exact mime type gives you trouble, I can write a snippet for you that'll take care of it. Or you can do it yourself if you're feeling brave

  18. TKPM
    Member
    Posted 1 year ago #

    Assuming it's application/pdf (as I've tried a few different pdf files); looks like filext.com is currently down.

    Thanks for all your help!

  19. TKPM
    Member
    Posted 1 year ago #

    Unfortunately, I've had no luck with the snippet, so any help would be greatly appreciated.

    On the bright side, I'm no longer receiving that syntax error when logging into the dashboard, guessing it worked itself out over time...

  20. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Try the new version and let me know if it works for you.
    http://downloads.wordpress.org/plugin/frontend-uploader.0.5.2.zip

  21. TKPM
    Member
    Posted 1 year ago #

    Just tried pdf and psd files and both worked! Thanks a ton!!

  22. Rinat Khaziev
    Member
    Plugin Author

    Posted 1 year ago #

    Marking as resolved

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic