• Resolved dmarin

    (@dmarin)


    Hi there!

    I have been using your plugin for about 2 years now for a specific file .ddd upload with no issues, worked like a charm. However, when I updated PHP to ver 8.3, it does not let me update same file any more saying “Sorry, you are not allowed to upload this file type.”

    I see that your plugin has not been updated in a while, can you please look into this issue? For now I am sticking with PHP ver 8.2 until you get it fixed. Please let me know when you plan to release new version that will be comaptible with ver 8.3

    Thanks!

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

Viewing 15 replies - 16 through 30 (of 30 total)
  • Thread Starter dmarin

    (@dmarin)

    Hey @kmacharia , I finally tested the ver 1.4 and the new uploader worked perfectly for UGC files. However, it did not work for DDD files in PHP 8.3, so I had to setup that File Type manually to “image/x-atari-degas” and now both file types work fine.

    So, even though I do not understand why DDD tachograph file type cannot be uploaded in PHP 8.3 unless setup manually as “image/atari-degas”, it works, so it’s good for now. It would be great to figure out why files are recognized as “application/octet-stream” though … or why it works the other way in PHP 8.2 but not in 8.3.

    Thanks again for solving the problem for now.

    Regards, Danijel

    Plugin Contributor kkarpieszuk

    (@kkarpieszuk)

    However, it did not work for DDD files in PHP 8.3

    Hi, I understand you dragged this file to the dropzone, right? What mime types has been recognized?

    or why it works the other way in PHP 8.2 but not in 8.3.

    That’s the question I would like to ask PHP authors as well ?? It is php interpreter engine responsibility to recognize file mime types. PHP communicates for this with underlying operating system. It seems they changed the logic for this process without mentioning this in the changelog

    Thread Starter dmarin

    (@dmarin)

    Yes @kkarpieszuk , I deleted old MIME definitions and then dragged both DDD and UGC files to the dropzone. UGC file was recognized as “text/xml” and “application/octet-stream” and it works perfectly.

    However, DDD file was recognized as “application/octet-stream” but could not be uploaded after I saved that setting. So i had to add it manually as “image/atari-degas” file, now I am able to upload it.

    Plugin Contributor kkarpieszuk

    (@kkarpieszuk)

    where exactly do you try to upload the file? front end, some form (build with WPForms or other form builder or custom solution?) or it is wp-admin? If wp-admin, do you try to upload to wp-admin > media library or insert into some post or page? If insert in the post, do you use Gutenberg? Please provide as much details as you could so I will try to troubleshoot this

    Thread Starter dmarin

    (@dmarin)

    @kkarpieszuk , so here is more info, again:

    • We upload these files through WP Customer Area plugin … these are files for clients that receive reports about the use of Tachographs.
    • However, in the process of testing I noticed that the same error (not being able to upload files) in PHP 8.3 was present even if I tried to upload a test file to Media Library.

    Hope that helps …
    Regards, D.

    Thread Starter dmarin

    (@dmarin)

    Hello again, @kmacharia and @kkarpieszuk ,

    Sorry to bother you again, but I am having problems again … you see, when some coworkers uploaded more files for Clients, they realized that they are still not able to upload all .DDD files. ?? You wee, it seems there are two types of .DDD tachograph files, one type is related to drivers and the other one to trucks that are driven.

    One of those files is being recognized as application/octet-stream and the other one as image/x-atari-degas. So, I tried to add both of these File Types separately (manually), but since they have same ending .ddd, that did not work. So, I had to restore PHP ver 8.2 for now.

    I tried uploading in both Media Library and WP Customer Area plugin with the same results. The other special file type UGC works fine no matter what.

    So, do you possibly have any other ideas what else could be done? I have uploaded several of these files again to WeTransfer, so you can download and try for yourself: https://we.tl/t-E5tYuuKXsB

    Please let me know if you can figure a good way to solve this problem with File Upload Types and PHP 8.3.

    Thanks, Danijel

    Thread Starter dmarin

    (@dmarin)

    Any update on this issue, @kmacharia and @kkarpieszuk ? Were you able to download test files?

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hi @dmarin

    Apologies for the delay. We are taking a look and I will share some news in a short while.

    Thanks for your patience!

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hey @dmarin

    We have reviewed the two files and it looks like for some odd reason that the Techographs are creating files with different MIME types. We have identified a possible fix and we suggest adding the following code to your site:

    add_filter( 'wp_handle_upload_overrides', 'dont_test_ddd_mime_type', 10, 2 );

    function dont_test_ddd_mime_type( $overrides, $file ) {

    // check if the file is a .ddd or .DDD file.
    if ( preg_match( '/\.ddd$/i', $file['name'] ) ) {
    $overrides['test_type'] = false;
    }

    return $overrides;
    }

    In case it helps, here’s our tutorial with the most common ways to add custom code like this.
    For the most beginner-friendly option in that tutorial, I’d recommend using the WPCode plugin.

    I hope this helps. Please keep me posted on how this goes. ??

    Thread Starter dmarin

    (@dmarin)

    Thanks for testing DDD files and for your reply, @kmacharia . Yes, two different MIME for the same file type .DDD is strange, indeed. ??

    So, just to make sure regarding the code:
    – is this PHP code to be used within WPCode plugin?
    – is this code needed in addition to any settings in your plugin OR should I remove DDD file type from your plugin first before adding the code?
    – do I even need your plugin if I use the code?

    I have heard of other solutions using functions.php file or even ALLOW_UNFILTERED_UPLOADS within wp-config.php file, but I am afraid those solution would make website vulnerable because any files types could be uploaded. So, still hope I can make it work for specific files with your plugin and/or code.

    Thanks!

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hey @dmarin

    Yes, you can either add this snippet in WPCode plugin or directly call it within your theme’s functions.php file but the former is recommended to protect the code from being lost if you update your theme.

    This code should be used alongside the File Upload Types plugin it just helps to override the check that is causing one of the file types not to work. We can also confirm that this code will not expose your site to any vulnerabilities since it is specific to the .ddd files.

    I hope this helps to clarify!

    Thread Starter dmarin

    (@dmarin)

    Hi @kmacharia , yes, it seems to work with PHP 8.3 and DDD files. Thank you!

    However, it seems as if the site is loading slower even though PHP 8.3 and WP 6.6.1 should be faster. Is it possible that it’s because of the PHP snippet code?

    Plugin Contributor kkarpieszuk

    (@kkarpieszuk)

    Hi, I am glad that it helped.

    The snippet does not have any effect on the regular side load. It affect only the process of file uploading and in fact, it should be faster now (but by some milliseconds only, so not noticeable) as now it does not check MIME type and only extension.

    Thread Starter dmarin

    (@dmarin)

    Ok, thanks again for your extended help with this issue, @kmacharia and @kkarpieszuk !

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hi @dmarin

    You are welcome! We’re thrilled to hear your issue is resolved!

    Your experience is important to us, and we’d love to hear what you think about using File Upload Types.? Would you mind sharing a quick review? It only takes a minute and helps us keep improving!

    Here’s the link to leave a review. We appreciate your time and feedback!

    Thanks ??

Viewing 15 replies - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.