Support » Plugin: flowpaper » Self-hosted PDF URL

  • Resolved cloudfactory



    thanks for this nice plugin.

    However I seem to have a problem when displaying self-hosted PDFs.

    If I insert this shortcode :

    [flipbook pdf=""]

    on, the generated src of the iframe becomes :

    which is not working (I get the “That does not seem to be a valid PDF url. Please check so the PDF exists.” error)

    If I replace manually the “?” before wp-hosted with an “&” in the URL, then it works perfectly :

    But the ?wp-hosted part is being added in the URL by your plugin (line 330 of file flowpaper.php)

    So I was wondering if I was doing something wrong ?

    Thanks for your help,


Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author getflowpaper


    You’re doing everything right – its something on your server that is preventing the file from being hosted from your wordpress uploads folder – easiest fix is just to upload it to a different folder (outside the wordpress installation) and you should be fine.



    Thanks for your answer but I don’t get it, there’s nothing on my server that is preventing the file from being hosted from the uploads folder, the file has been uploaded successfully and is accessible.

    Or maybe you meant there’s something on *your* server that is preventing that ? In this case may I know why ?
    I would like this file to be uploaded by users in the back office so I need it to be in the uploads folder.

    Thanks again,


    Plugin Author getflowpaper


    Could you share the full real url to the PDF with us so we can have a look? Feel free to send it to send it to if you don’t want to post it here

    I have the same situation here.
    If I manually edit the flowpaper.php file in the plugin folder, everything works.
    The only thing I did is replace the question mark symbol ? on line 330 and line 332 with the ampersand symbol &.
    So line 330 changed from
    $pdfUrl = '' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":"");
    $pdfUrl = '' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"&wp-hosted=1":"");
    and line 332 changed from
    $pdfUrl = '' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"?wp-hosted=1":"");
    $pdfUrl = '' . esc_attr( $value ) . (strpos(esc_attr($value),WP_CONTENT_URL)===0?"&wp-hosted=1":"");

    Any chance you can make the change upstream?

    Notice the structure of those lines. They create an HTTP query string with values for php variables to be passed to flowpaper. Such query strings have one question mark after the actual address of the php file being invoked. This question mark indicates the start of an array of variables in the form of variable=value separated by an ampersand & sign to form a URL that looks like

    In the case of your plugin, you’re currently passing the question mark twice – the first time with the variable at the start of lines 330 & 332, and the second time with the ?wp-hosted=1 variable at the end of those lines. So the final URL ends up looking like so:

    This means that those values are not passed to flowpaper, but interpreted by it as part of the url, sending them to the pdf file and eventually returning an error to flowpaper.

    Changing the ? to an & before wp-hosted makes this variable and all the others after it be passed to flowpaper and understood by it.

    • This reply was modified 9 months, 4 weeks ago by  finomeno.

    Thnaks @finomeno for the detailed explanation, this is exactly the problem I was trying to describe in my first post 🙂

    @getflowpaper, I have only just seen your answer. finomeno’s explanations should be enough, do you want me to send an email anyway ? I couldn’t explain it better than he did and I can’t send you the full real URL of the file because the website I’m working on is not online yet.

    For the moment I’m going to replace the ? with an & in the plugin source code manually, until you fix it upstream (I hope you will anyway!)

    Have a nice day,


    Issue not resolved yet. Fixes work, but plugin has still not been updated with correct code.

    Plugin Author getflowpaper


    Hi there,
    It may look funny with 2 question marks in the url but it gets handled correctly once passed to the viewer (see example here: so there must be something else that goes wrong once the url gets translated. Having 2 question marks is actually valid – the second question mark will be treated as a literal (see and our scripts will handle it.

    Could you post a full url to where you have set this up?

    I have same issue with wp-hosted=1, if I remove from following url , it starts working.
    But it is build in with plugin, so I can not remove it. Is there any workaround?

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