Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2010
    Posts
    235
    Thanks
    39
    Thanked 6 Times in 6 Posts

    (fwrite or fputcsv) export to windows directory

    I am trying to write a csv file to a windows7 directory.

    C:\Users\mathceleb\Desktop\CUI05_02_09_01.csv

    PHP Code:
    $handle fopen($output_file_name'w+'); 
    This is what comes out as my $output_file_name parameter. I also checked Microsoft Excel and the directory is listed exactly like this as well if I open the file.

    This is not working. However, when I remove the output path portion and just have the filename, the file writes and exports correctly.

    I checked Google and did not find much. Any thoughts?
    Last edited by mathceleb; 05-02-2011 at 04:11 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I would doubt its the same file. Assuming you are using PHP through apache, its highly improbable that the path you have is published as a web directory.
    Enable your error reporting, I'd be betting on a permissions error on this one.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Older post responded to, refer to http://www.codingforums.com/showthread.php?t=224003
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

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