Support » Plugin: Lana Downloads Manager » Downloaded files are empty after migration

  • Resolved pictosonic

    (@pictosonic)


    I have set up a preprod web site where lana-document works fine.
    I have transfered this site to a production server with another domain name.
    Everything works fine except that if I download a file uploaded with lana-documents on the preproduction web site, it is downloaded as an empty file on the production web site.
    If I upload a new document on this final production website, it is working fine, the file is not empty when downloaded.
    Having access to ssh, I have checked the file rights and they are correct, and they are similar rights between the file that are downloaded empty and the new file that is downloaded with its content.
    I have checked php error log, no error.
    I have updated the guid column of the wp_posts table so that the urls it contains are also migrated to the new domain name, but it did not fix the problem.
    Since I have almost 100 downloaded files, I am eager to find a solution !

    Since it is in a migration context, beyond the normal usage, I do not expect you to fix this, but may be you could provide me some tips or leads ?

    Thank you very much for your assistance,

    Working:
    https://corli.huma-num.fr/download/1296/

    Not working:
    https://corli.huma-num.fr/download/1242/

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Lana Codes

    (@lanacodes)

    Both of the links you send work for me. I can download the files. But the non-working one really returns an empty file, which is interesting.
    If the plugin could not find the file, it would give the error message “file not found”.

    One of the most important things when moving a website is to update the permalink after change the urls, you can do this in the admin page in Settings > Permalinks, where you click the Save Changes button.
    Please go to Downloads > Settings and update the URL settings. Maybe that will help.

    To change the URLs, I recommend the “Go Live Update Urls” plugin.

    Can you verify that both files are in the wp-content/uploads/lana-downloads folder?
    What you should definitely check is the permissions of “the wp-content/uploads/lana-downloads” folder.

    What I might look at is the HTTP and HTTPS and the WWW match in the URL.
    So if you move to http://lanacodes.test/ to https://lanacodes.production/, but only change “lanacodes.test” to “lanacodes.production” in the url, HTTPS will not match, this may cause an error.

    If you are using a cache plugin, empty it or turn it off while you are testing.
    The “Query Monitor” plugin can help with testing and debugging.

    I will be happy to help you, either in a comment here or, if it is easier, contact me by email.

    Plugin Author Lana Codes

    (@lanacodes)

    I tried to test it and at first it seems that WWW matching is the problem.

    So if you move to https://www.lanacodes.test/ to https://lanacodes.production/, but only change “lanacodes.test” to “lanacodes.production” in the url, WWW will not match, this cause an error.
    I got the same error in this case. The file was downloaded, but the file was empty.

    So if my website URL is https://lanacodes.production/, but the download URL for the file is https://www.lanacodes.production/wp-content/lana-downloads/file.pdf is then faulty, not working.

    So please review the migration URL.

    Check Settings > General on the production website for “WordPress Address (URL)” and “Site Address (URL)”.
    Check for HTTP and the WWW. Be sure to rewrite the full URL, everything must match.

    Hello,

    Thank you for you answer.
    I have rechecked every point and everything seems fine but the mysterious empty file phenomena is still there.

    – wordpress configuration: web site url and wordpress url are coherent and identical (no subfolder installation). The url is https://corli.huma-num.fr/ there is no www prefix.
    – permalinks set to publication title
    – files can be listed in the expected upload folder, they are not missing
    – folder permissions: working files have same permission as non working files
    – urls in the guid column of the posts table in database seem to be OK (I provide a csv dump of them)
    – htaccess seems fine

    I forgot to mention that WPML is installed; however, no lana download post has been translated.

    I have sent you an email,
    Thank you !

    Plugin Author Lana Codes

    (@lanacodes)

    As we talked about in the email, you reviewed the links again, and as it turned out, you found the error in postmeta:

    in the download post type file url meta did not change to the production url from dev url.

    Note for other users who also have problems after migration:
    To change the URLs, I recommend the “Go Live Update Urls” plugin. It replaces all urls in all database tables.

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