We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: CSVee

Development and Programming

Tom Jaeger's avatar
Tom Jaeger
228 posts
15 years ago
Tom Jaeger's avatar Tom Jaeger

Hmmm. From here I would be apt to check the permissions on the uploads folder to confirm they are 777 (I’m sure you already have). In addition to which I would throw error reporting into the plugin at about line 35 to see if there is any further information we can get.

error_reporting(E_ALL);
ini_set('display_errors', '1');
       
Ryan M.'s avatar
Ryan M.
1,511 posts
15 years ago
Ryan M.'s avatar Ryan M.

I changed

header('Content-Disposition: inline; filename="'.$the_filename.'"');

to

header('Content-Disposition: attachment; filename="'.$the_filename.'"');

and things seem to be working OK. Safari appends “.html” to the resulting filename, but Firefox behaves fine. Removing the “.html” results in a perfectly usable .csv file.

       
verveuster's avatar
verveuster
34 posts
15 years ago
verveuster's avatar verveuster

hi ryan thank you for your work and help.

i tried your change in the header and it works like you said.

strange that the export worked before. any idea what could have changed?

thanks res

       
Ryan M.'s avatar
Ryan M.
1,511 posts
15 years ago
Ryan M.'s avatar Ryan M.

I really don’t know what changed. This plugin used to work fine for me until now. Seems to work OK with “Content-Disposition: attachment”, though!

       
Scotta's avatar
Scotta
136 posts
15 years ago
Scotta's avatar Scotta

Hello,

Why is there two archives at the begginning of the thread ? Wich one should I use ?

Thanks.

       
ccarter's avatar
ccarter
9 posts
15 years ago
ccarter's avatar ccarter

@Daniel. Thanks for your reply about my problem which to restate it is that I can’t seem to get the proper seperator. I have tried over and over in various ways including your suggestion of just using seperator=”“. Nothing works. Here is my latest:

{exp:csvee seperator="," query="SELECT email FROM exp_members WHERE email !='[email protected]' AND email !='[email protected]'" show_headings="no"}

It seems simple but nothing seems to work. I was able to get the delimiter I want, which is a space only by editing the plugin itself. Even trying that for the seperator doesn’t help. Any suggestions? Thanks, Carole

       
gavincooper's avatar
gavincooper
51 posts
15 years ago
gavincooper's avatar gavincooper

@Daniel

{exp:csvee filename="survey.csv" seperator="," query="SELECT name, email, q1, q2a, q2b, q2c, q2d, q3a, q3b, q3c, q3d, q4a, q4b,q4c,q4d,q5   FROM exp_freeform_entries ORDER BY entry_date DESC " }

I am getting the results as text in the browser window, but I am trying to get a CSV file as a download. Is there something missing from my code?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
15 years ago
Ryan M.'s avatar Ryan M.

@gavincooper: I was having the same issue. Note the change I had to make in the plugin in this earlier post.

       
gavincooper's avatar
gavincooper
51 posts
15 years ago
gavincooper's avatar gavincooper

Excellent Ryan! worked like a charm. The file has a .html that needs to be removed, but then works great. Although, my CSV file is putting all of the results in one row. The column heads are first and then the results are to the right instead of underneath. Anyway, I can wrap the results underneath the columns heads?

       
pixelpie's avatar
pixelpie
11 posts
15 years ago
pixelpie's avatar pixelpie

Hi there! Does anyone know if it’s possible to get the CSV file to download when loading the template. Maybe i’m doing something wrong, but when I load the template i just get the query results displayed at the browser, but not CSV file to download. Is it suppose to be like that?

This is the code that i’m using:

{exp:csvee delimiter=","
filename="test.csv"
query="SELECT 
exp_weblog_titles.title as name
FROM exp_weblog_data 
INNER JOIN exp_weblog_titles ON exp_weblog_data.entry_id = exp_weblog_titles.entry_id 
WHERE exp_weblog_data.weblog_id='16' 
ORDER BY exp_weblog_titles.title ASC"}

Thanks!

       
Ryan M.'s avatar
Ryan M.
1,511 posts
15 years ago
Ryan M.'s avatar Ryan M.

ax2000: You did read the last few posts, right?

       
pixelpie's avatar
pixelpie
11 posts
15 years ago
pixelpie's avatar pixelpie

Ooops.. Sorry about that Ryan. I read it now and changed the line as you said and works fine!

Thanks a lot.

       
jgreenstein's avatar
jgreenstein
29 posts
14 years ago
jgreenstein's avatar jgreenstein

hi

i am a nube…how do I add a line break?

{exp:csvee query = "SELECT field_id_37,  field_id_39,  field_id_41,  field_id_45 FROM exp_weblog_data WHERE field_id_48='Yes'" show_headings='no'}
       
First 6 7 8

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.