Results 1 to 3 of 3

Thread: how to save files to user's local harddrive

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Posts
    237

    how to save files to user's local harddrive

    hi all, I tried to save data to a text file on the user's local hard drive, here's the code:

    VB Code:
    1. $filename = "D:\savefile " .date("Y-m-d, h-i-s") . ".txt";
    2. $fh = fopen($filename, "a");
    3. $success = fwrite($fh, $data);
    4. fclose($fh);

    but why is it on on the user's local harddrive? it's on the hosting's drive.
    how can I make it save to the user's local harddrive?

    thanks

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: how to save files to user's local harddrive

    You can't do that. Sorry.

    PHP runs on the server, so it will always create the file on the server. For security reasons, you cannot create a file on the users system.
    Last edited by visualAd; Feb 2nd, 2006 at 04:00 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: how to save files to user's local harddrive

    PHP won't let you because it is server side...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width