Results 1 to 4 of 4

Thread: Save to CSV file not working, Directory path

  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Default Save to CSV file not working, Directory path

    Reviewed all of the posts concerning csv file problems but still can't get formmail to recognize the path to the directory. I tried "pwd" while logged in via SSH to get the full path and even the php.info test code to find the path, but neither of the paths specified work! Also, the error email shows that the formdata file is in a directory below formdata.csv. Other paths I tried result in a double slash showing between the directory and formdata.csv (in the error report). This directory or path does not exist. Any suggestions? Should the csv file be chmod 777? Does the directory containing formdata have to be at root level of the site?

    The following error occurred in FormMail:
    Failed to open CSV file '/home/myname/public_html/admin/csvdir/formdata.csv/formdata.csv'

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Save to CSV file not working, Directory path

    Hi,

    You need to set $CSVDIR in formmail.php to the directory path you create, and then a hidden field called "csvfile" in your form to a file name (no path) you've created in $CSVDIR.

    Should the csv file be chmod 777?
    chmod 666 is appropriate for the file. 755 or 711 for the directory the file contains.

    Does the directory containing formdata have to be at root level of the site?
    The directory can be anywhere on the computer. In general, it's better to have the $CSVDIR directory above your web server's document root. Doing this means that no-one can get to the files in there from a web browser.

    Failed to open CSV file '/home/myname/public_html/admin/csvdir/formdata.csv/formdata.csv'
    At a guess, I'd say you may have set $CSVDIR to ''/home/myname/public_html/admin/csvdir/formdata.csv' and then set "csvfile" in your form to the same value.

    Instead, you need:
    PHP Code:
    $CSVDIR "/home/myname/public_html/admin/csvdir"
    or as discussed above:

    PHP Code:
    $CSVDIR "/home/myname/csvdir"
    and then in your form you want:

    Code:
    <input type="hidden" name="csvfile" value="formdata.csv" />
    You must create the file yourself (FormMail won't create it). The mode should be, in general:

    Code:
    chmod 666 formdata.csv
    If you're still stuck, email your form and formmail.php to me at supportstaff AT tectite DOT com.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Oct 2004
    Posts
    2

    Thumbs up Re: Changed path in Formmail.php, Now csv works

    Russell,

    Thank you very much for the help, I formatted the path in Formmail.php according to the example you provided and double-checked that the form had the proper data (it was ok). This time it worked like a charm! Data was saved in the .csv file and no error messages delivered. It's a great script, well thought out and much more versatile than the regular CGI formmail, with plenty of features. Your level of support for a free product should be commended, if you run the rest of your business with the same kind of attitude you are headed straight to the top.

    Thanks again!

    Mike

  4. #4
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Save to CSV file not working, Directory path

    Hi Mike,

    I'm glad you got it working.

    We'd appreciate a link to our website - it really does help us continue to provide free software and free support.

    Let me know if you need help with anything else.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Attaching CSV file
    By eu4ic in forum FormMail Subscription Support
    Replies: 6
    Last Post: 01-Jun-2005, 10:58 PM
  2. what does a CSV file do?
    By gwbosma in forum FormMail Subscription Support
    Replies: 1
    Last Post: 20-Nov-2004, 08:20 PM
  3. csv file problems
    By Badnet in forum FormMail Subscription Support
    Replies: 2
    Last Post: 12-Nov-2004, 02:06 AM
  4. Downloading CSV file in Access
    By jgold723 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 30-Aug-2004, 10:35 AM
  5. to save in csv.
    By nexile in forum FormMail Subscription Support
    Replies: 4
    Last Post: 13-Aug-2004, 10:32 PM

Bookmarks

Posting Permissions

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