WordPress.org

Ready to get started?Download WordPress

Forums

Download Message for User in Plugin (4 posts)

  1. golddave
    Member
    Posted 7 years ago #

    I have a plugin that, among other things, will auto download files if specific conditionas are met. I want to put up a message telling the user that files are downloading (in the even that they actually are). I've tried 'echo'ing text but the text doesn't appear on the page until after the download occurs. Why does that happen? How would I go about giving the user an indication that I'm downloading something while they're waiting for the page to load?

    Thanks.

  2. Austin Matzko
    Member
    Posted 7 years ago #

    Take a look at the wp-db-backup.php plugin that comes with a default copy of WordPress. It uses an iframe and JavaScript to provide real-time progress status for backups.

    Basically, you would run your PHP download script by changing the src of the iframe, and then use JavaScript on that iframe page to indicate your status for the top page.

  3. golddave
    Member
    Posted 7 years ago #

    That's great. Any help breaking it down would be greatly appreciated. I'm working on it now but I'm learning PHP as I'm doing things so I'm not the most advanced coder on the block.

  4. golddave
    Member
    Posted 7 years ago #

    I've tried to pull out the progress bar code from wp-db-backup.php but I can't get it to work.

Topic Closed

This topic has been closed to new replies.

About this Topic