Jump to content

Search the Community

Showing results for tags 'submissin'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi y'all! Im am trying to force a file download after user submits a form. When user hits submit button POST data are send to a template (sort of "thank you for downloading" page). This template on successful submission redirects to another template through this code <?php $downloadurl = $pages->get('/download/')->url; header('refresh: 0; url='.$downloadurl); ?> Redirection then hits this template code (located in download template): <?php // filename & url of the pdf file $filename = $pages->get('/some-page/')->file->name; $fileurl = $pages->get('/some-page/')->file->url; $filesize = $pages->get('/some-page/')->file->filesize; // force download of the file header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename='.$filename); header("Content-Length: ".$filesize); readfile($fileurl); It downloads a file and then redirects back to thank you page. The only problem is that the downloaded file is empty (0KB). When i download a file "the standard way" clicking on a link that directs to $pages->get('/some-page/')->plik->url; everything is ok. Any ideas?
×
×
  • Create New...