markcasio Member Licensed User Longtime User Jul 8, 2019 #1 Hi, Is there a way to configure jserver to download my pdf file instead of showing a preview ? I used content-disposition without result. <meta name="content-disposition" content="inline;filename=testfile.pdf">
Hi, Is there a way to configure jserver to download my pdf file instead of showing a preview ? I used content-disposition without result. <meta name="content-disposition" content="inline;filename=testfile.pdf">
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2019 #2 Moved to B4J forum. Upvote 0
markcasio Member Licensed User Longtime User Jul 9, 2019 #3 added hanlde using resp.SetHeader("Content-disposition", $"attachment; filename=${myfileName}"$) Still no result , but I'm getting close. Upvote 0
added hanlde using resp.SetHeader("Content-disposition", $"attachment; filename=${myfileName}"$) Still no result , but I'm getting close.
alwaysbusy Expert Licensed User Longtime User Jul 9, 2019 #4 Have you tried also setting the content type as octet-stream? (in addition to your SetHeader) B4X: resp.ContentType = "application/octet-stream" Upvote 0
Have you tried also setting the content type as octet-stream? (in addition to your SetHeader) B4X: resp.ContentType = "application/octet-stream"
markcasio Member Licensed User Longtime User Jul 9, 2019 #5 Problem solved. Thank you Alwaysbusy, after adding the contenttype the file can be saved using the dialog. Upvote 0
Problem solved. Thank you Alwaysbusy, after adding the contenttype the file can be saved using the dialog.
moster67 Expert Licensed User Longtime User Jul 9, 2019 #6 This worked for me: https://www.b4x.com/android/forum/t...f-download-from-fileserver.88500/#post-560170 Upvote 0
This worked for me: https://www.b4x.com/android/forum/t...f-download-from-fileserver.88500/#post-560170
markcasio Member Licensed User Longtime User Jul 9, 2019 #7 I understand monster67 , inline is opening the file and attachment is downloading it. But without setting the contenttype my file won't download. Upvote 0
I understand monster67 , inline is opening the file and attachment is downloading it. But without setting the contenttype my file won't download.