• Resolved ddjeanne

    (@ddjeanne)



    Hello, would it be possible in the export file to delete the parameter at the end of the url “&dl=1”. I would like the files to open in the default browser. This concerns the File upload fields. Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @ddjeanne,

    Yes that is possible! By default we choose to add the download attribute as it makes the most sense for most of our customers. So there isn’t a hook to disable that behaviour (yet).

    However, we can change the output value with a different hook.

    If you add the following snippet to your functions.php or via the CodeSnippets plugin, it should remove that part from those urls.

    add_filter( 'gfexcel_field_value_fileupload', function ( $value ) {
    	return str_replace( '&dl=1', '', (string) $value );
    } );

    See https://gfexcel.com/docs/changing-values/ for more information on this hook.

    Kind regards,

    Doeke

    Thread Starter ddjeanne

    (@ddjeanne)

    Hello, thank you very much for your response. It works if there is a file downloaded. But I have enabled the Multiple Files – Enable Multiple File Sending option. field_value_fileuploads ? Thanks

    Plugin Author Doeke Norg

    (@doekenorg)

    @ddjeanne For multiple files it should still work with the same hook. Could you show me the output you are getting? Are we still talking about the URL’s inside an Excel File? Sorry for my confusion.

    Thread Starter ddjeanne

    (@ddjeanne)

    Yes, we are still talking about the URL’s inside an Excel File.

    Field File upload field : it’s ok

    Field File upload field with Multiple Files option : always &dl=1

    • This reply was modified 4 months, 2 weeks ago by ddjeanne.
    Plugin Author Doeke Norg

    (@doekenorg)

    @ddjeanne Ah, I see now. Unfortunately there is a missing piece in the plugin to accommodate this currently.

    I’ll fix it with a custom hook to disable the forced download. I’ll update you when this is released.

    Sorry for the inconvenience.

    Thread Starter ddjeanne

    (@ddjeanne)

    ok thanks

    Plugin Author Doeke Norg

    (@doekenorg)

    @ddjeanne sorry for the delay. I’ve just released version 2.3.3.

    If you add add_filter('gfexcel_field_fileuploads_force_download', '__return_false'); this should remove &dl=1 from all url’s now.

    Please let me know if this resolves your issues.

    Kind regards,

    Doeke

    Thread Starter ddjeanne

    (@ddjeanne)

    Thanks, it works. But we are limited by Excel. With Excel, you can add only one hyperlink in a single cell. Thanks again for everything

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.