CSV data error Can't open file

Issues related to forms.
Post Reply
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

CSV data error Can't open file

Post by petejos »

Hi there,

I am trying to find a solution in the forum for my problem, but can't seem to find it. I created a form www.goec.com.au/goec2/welcomeform.php
csv path is ./public_html/forms/welcomeform/welcomeform.csv. I have send the csv to both 666 and 777 permission, but still getting the error. can someone please shed some light for me? Thanks.
User avatar
Pablo
 
Posts: 21708
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CSV data error Can't open file

Post by Pablo »

This most likely means that the configured path is incorrect.

If the page is in the same folder as the csv file then the path should be:
"welcomeform.csv"
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: CSV data error Can't open file

Post by petejos »

No, the page is different folder from the CSV. The page is in public_html/goec2.
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: CSV data error Can't open file

Post by petejos »

Hi Pablo,

Is there a guide on how to set the form using CSV? Should I use HTML or rich text for the respond field? Or it doesn't matter?
MGD4me
 
 
Posts: 288
Joined: Tue May 02, 2017 11:56 pm
Location: British Columbia, Canada

Re: CSV data error Can't open file

Post by MGD4me »

You do not "normally" need to specify the public_html portion of the path. It is implied.

Try setting the path to the csv file to be /forms/welcomeform/welcomeform.csv instead.
User avatar
Pablo
 
Posts: 21708
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CSV data error Can't open file

Post by Pablo »

You will need to set the path of the csv relative to the page with the form.
It is not common to include 'public_html'.

Note that this is not specific to WWB:
https://www.w3schools.com/html/html_filepaths.asp
petejos
 
 
Posts: 155
Joined: Wed Aug 22, 2012 11:43 am

Re: CSV data error Can't open file

Post by petejos »

Thanks.
1. This is where my csv form location. Is this correct?
./forms/welcomeform/welcomeform.csv

2. Where should I put the my page with the form?
User avatar
Pablo
 
Posts: 21708
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: CSV data error Can't open file

Post by Pablo »

You can place the CSV file anywhere you want.
What is important is that you use the correct path

If the form is in the same folder as the CSV file then the path should be
./welcomeform.csv

If the csv file is in a sub folder then the path is
./subfolder/welcomeform.csv

The path is relative to the current folder (where the page is).
Post Reply