0

I am using file put contents and set a file name but file saved on the directory where the script was written. How to do to set the full path to save to disc or desktop. Something like browse window and save path.

$fileName = 'etykieta_' . $package_no . '.' . $xml->label->format;
file_put_contents($fileName, base64_decode($xml->label->base64));

And i want to set a file path in a window.

Bhumi Shah
  • 9,323
  • 7
  • 63
  • 104
usmauriga
  • 73
  • 1
  • 1
  • 5
  • 2
    Show us your code ..!! – Yash May 09 '16 at 12:51
  • 1
    Possible duplicate of [using the browser prompt to download a file](http://stackoverflow.com/questions/11315951/using-the-browser-prompt-to-download-a-file) – Mihai Matei May 09 '16 at 12:56
  • you can use DOCUMENT_ROOT and set path where you want to save this file e.g $path = $_SERVER['DOCUMENT_ROOT'].'/yourpath/'; file_put_contents($path . $fileName, base64_decode($xml->label->base64)); – Mukesh Ram May 11 '16 at 13:24

0 Answers0