-3

i have a website which is resposive and built mainly for mobile use, Now i want to save a text file to mobile either memory, But from what i have tried it directly saves the file in server. is there a way to save it in mobile memory or giving such patch that it can be saved outside the root directry?

$handle = fopen($backup_name,'w+');
fwrite($handle,$content);
fclose($handle);
echo 'done';

this is what i have checked so far, in pc i can store it any where but i need it to store in certain location of mobile

Mps
  • 131
  • 1
  • 14
  • You can download that file. Is this what you are looking for?? – Akbar Soft Aug 24 '18 at 03:21
  • yeah! but i have tried to force download which didnt worked so now i'm trying to write that file to a certain location, if there is a way provide the link so i check it – Mps Aug 24 '18 at 03:23
  • if I understand it properly, apache symbolic link might be what you are looking for. – Ggg Aug 24 '18 at 03:34
  • https://stackoverflow.com/questions/11903436/write-a-text-file-and-force-to-download-with-php – Akbar Soft Aug 24 '18 at 03:37
  • If you find a solution for your issue please mark bro)) – Akbar Soft Aug 24 '18 at 03:38
  • i dont know whether permission issue or something else its still shows the text without downloading it, by the way i'm running it on 000webhost.com for free – Mps Aug 24 '18 at 03:42

1 Answers1

0

make .htaccess file inside your downloadable content folder and put below code, Then it will download instead of showing the code.

AddType application/octect-stream .txt

If it is a .txt file you should do like above. You can put any file type by it's extension.

LahiruTM
  • 638
  • 4
  • 16