LucaMs Expert Licensed User Longtime User Oct 14, 2017 #1 I searched everywhere (mostly on StackOverflow) without success. Is there a way to download SQLite files using PHP from a classic free hosting space (Altervista, in my case)? [I cannot use FTP because there is no way to protect files to be deleted] Thank you
I searched everywhere (mostly on StackOverflow) without success. Is there a way to download SQLite files using PHP from a classic free hosting space (Altervista, in my case)? [I cannot use FTP because there is no way to protect files to be deleted] Thank you
S sorex Expert Licensed User Longtime User Oct 14, 2017 #2 I don't see why it shouldn't work. worst case you need to zip it as it might block the extention or because it has no extention at all. Upvote 0
I don't see why it shouldn't work. worst case you need to zip it as it might block the extention or because it has no extention at all.
LucaMs Expert Licensed User Longtime User Oct 14, 2017 #3 sorex said: I don't see why it shouldn't work. worst case you need to zip it as it might block the extention or because it has no extention at all. Click to expand... I'm trying. Now I can download the SQLite file (not zipped) but it seems to be corrupted (the orginale, on site, is ok, of course). Upvote 0
sorex said: I don't see why it shouldn't work. worst case you need to zip it as it might block the extention or because it has no extention at all. Click to expand... I'm trying. Now I can download the SQLite file (not zipped) but it seems to be corrupted (the orginale, on site, is ok, of course).
S sorex Expert Licensed User Longtime User Oct 14, 2017 #4 you'll need to force a binary header to make sure it doesn't corrupt. B4X: header('Content-Transfer-Encoding: binary'); Upvote 0
you'll need to force a binary header to make sure it doesn't corrupt. B4X: header('Content-Transfer-Encoding: binary');
LucaMs Expert Licensed User Longtime User Oct 14, 2017 #5 sorex said: you'll need to force a binary header to make sure it doesn't corrupt. B4X: header('Content-Transfer-Encoding: binary'); Click to expand... Done but same result Thank you Upvote 0
sorex said: you'll need to force a binary header to make sure it doesn't corrupt. B4X: header('Content-Transfer-Encoding: binary'); Click to expand... Done but same result Thank you
S sorex Expert Licensed User Longtime User Oct 14, 2017 #6 zip it up then and extract in the app Upvote 0
LucaMs Expert Licensed User Longtime User Oct 14, 2017 #7 sorex said: zip it up then and extract in the app Click to expand... Right now an italian member managed to get the correct file. I suppose my php is wrong, probably the length set: header('Content-Length: ' . filesize($File)); Upvote 0
sorex said: zip it up then and extract in the app Click to expand... Right now an italian member managed to get the correct file. I suppose my php is wrong, probably the length set: header('Content-Length: ' . filesize($File));
S sorex Expert Licensed User Longtime User Oct 14, 2017 #8 it should set it automatically. maybe you need an additional content type to make it work right. Upvote 0
S sorex Expert Licensed User Longtime User Oct 14, 2017 #9 by the way... if you store the file first on your server you can just use the header function to redirect to the url of the file which downloads the file without the misery of setting the right headers. Upvote 0
by the way... if you store the file first on your server you can just use the header function to redirect to the url of the file which downloads the file without the misery of setting the right headers.
LucaMs Expert Licensed User Longtime User Oct 14, 2017 #10 Now I can download a correct SQLite file; but why? Now I moved the script file to the same folder where the file to download is. But before, having that file (modified) in a different folder, the script found the file anyway, it was downloaded but it was corrupt! I don't know Now I have to create a b4a client; will I have other problems? SURE Thank you. Upvote 0
Now I can download a correct SQLite file; but why? Now I moved the script file to the same folder where the file to download is. But before, having that file (modified) in a different folder, the script found the file anyway, it was downloaded but it was corrupt! I don't know Now I have to create a b4a client; will I have other problems? SURE Thank you.
LucaMs Expert Licensed User Longtime User Oct 14, 2017 #11 LucaMs said: Now I have to create a b4a client; will I have other problems? SURE Click to expand... Done in 2 minutes and it works at first attempt! Really incredible Upvote 0
LucaMs said: Now I have to create a b4a client; will I have other problems? SURE Click to expand... Done in 2 minutes and it works at first attempt! Really incredible