In ChronoForms v4 stable, I have used the file downloader action, on the submit form event, and I needed to do some corrections / improvements, in the run function.
I'm attaching fixed file.
CUSTOM EDIT 1: in download mode ($dest == 'D'), used in headers real Content-Type and let download to browser with "Content-Disposition: attachment"; this is in order to allow the user to prewiew type of file to download, and correctly open directly from browser (without saving first).
Here seems that the usage of appliction/download or application/force-download is not needed, and in fact in my PHP developer experience I never used it:
http://stackoverflow.com/questions/10615797/utility-of-http-header-content-type-application-force-download-for-mobile
CUSTOM EDIT 2: replaced return with die(), as I does not need to continue execution (this caused memory overflow error)
I hope you could include these improvements in your next releases.
I'm attaching fixed file.
CUSTOM EDIT 1: in download mode ($dest == 'D'), used in headers real Content-Type and let download to browser with "Content-Disposition: attachment"; this is in order to allow the user to prewiew type of file to download, and correctly open directly from browser (without saving first).
Here seems that the usage of appliction/download or application/force-download is not needed, and in fact in my PHP developer experience I never used it:
http://stackoverflow.com/questions/10615797/utility-of-http-header-content-type-application-force-download-for-mobile
CUSTOM EDIT 2: replaced return with die(), as I does not need to continue execution (this caused memory overflow error)
I hope you could include these improvements in your next releases.