• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with CSV file uploads not being allowed

[eluser]Nathan Pitman (Nine Four)[/eluser]
I've just migrated a small app I wrote from one environment to another and I've run into a weird issue with MIME types and the file upload class. I'm uploading a CSV file through a web form and where previously this worked on the new host using the same reference CSV file I get the error:

The filetype you are attempting to upload is not allowed.
[file_type] => text/x-lisp ) )

I've tried adding text/x-lisp to the application mimes.php CSV array but that makes no odds. I can't even seem to find a clean reference to this mime type online. This occurs both in FF and Chrome so I'm not convinced that it's a browser issue. This is a Smart Machine at Joyent that the app is running on.

[eluser]Nathan Pitman (Nine Four)[/eluser]
Bump... :?

It is indeed not a browser issue - the whole point is to not depend on what the browser sends in order to avoid exploits. It is not a bug either and there are numerous topics here on the forums explaining that. Here's my latest one, short: http://ellislab.com/forums/viewreply/1040236/

I too find it hard to believe that text/x-lisp is returned for a CSV file though, but if the server says so - there's not much you can do about it.

[eluser]Nathan Pitman (Nine Four)[/eluser]
Thanks for the suggestion RE outputting the mime type for the file directly via PHP, doing so highlighted that the 'file type allowed' error I was receiving wasn't realted to the CSV at all but actually to an HTML file being uploaded at the same time (slaps head!). In any case I've now removed 'text/x-lisp' from mimes.php for CSV and added it for html and htm. Problem solved! Smile

Thank you!!!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.