Coursepress File Download Error: file is empty

Hi guys!

I created a File Download element in a course. It's a 13MB file.

When a student try to download the file, he gets an error: the file is empty. If I test the file URL, it works. But inside the unit, the error occurs.

Here's a screenshot of the unit.

I don't know what is causing this error. I tested in localhost and everything works fine.

  • Adam Czajczyk
    • Support Gorilla

    Hello Frederico,

    Thanks for granting access!

    I've accessed your site and checked it and I was able to replicate the issue. However, I've also noticed that you're running an outdated 1.2.6.6 version of CoursePress Pro plugin.

    There's been some important fixes added since than so could you please update the plugin to the current 1.3 release and then clear your browser's cache and give it another try?

    Let me know if this made your downloads work, please.

    Best regards,
    Adam

    • Fred Peres
      • Flash Drive

      Didn't work, Adam. I still have the problem.

      And there's another one: in the /wp-admin/ I get the error:

      Warning: call_user_func() expects parameter 1 to be a valid callback, invalid function name in /home/aic/aic.org.br/ead/wp-content/plugins/coursepress/includes/classes/class.course.unit.module.php on line 860

  • Adam Czajczyk
    • Support Gorilla

    Hello Frederico,

    Thank you for giving it a try. I suggested update because there's been some fixes included and my tests (on my sandbox) with your files using the recent CoursePress release didn't let me replicate the issue on my end.

    As for error. That's a PHP warning and although it does suggests an "error" it's nothing serious to worry about I think. Is there this line in your "wp-config.php" file?

    define('WP_DEBUG', true):

    If so, you may safely remove it or change "true" to "false" and I think it should remove the warning message. It shouldn't affect plugin's performance though.

    As for file download. I just noticed another difference between your and my setup that I think may be worth exploring. Could you please add following line to your "wp-config.php" file?

    define('WP_MEMORY_LIMIT', '256M');

    This will raise the limit of server memory available to WordPress to the level available to PHP. Hopefully, it will help here.

    Keep me updated please!
    Best regards,
    Adam

  • Milan
    • WordPress Wizard

    Hello @contato133,

    Hope you are well today.

    We are glad that your issue with PDF file has been solved now. :slight_smile:

    Now can you paste this line,

    error_reporting(0);

    in your wp-config.php file exactly after this line ?

    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    Please do this and let us know how it goes. Even after doing this, you get that warning again then Would you be able to send in your FTP and wp-admin credentials so I could take a closer look ?

    You can send the info through our private contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic - this and the subject line ensure that it gets assigned to me :slight_smile:

    Send in:

    Subject: "Attn: Milan Savaliya"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Once we have this information then I can debug the issue further :slight_smile:

    Look forward to hearing back!

    Cheers,
    Milan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.