not a valid file with CSV extension

Permalink Browser Info Environment
Hi
I keep getting the above error with the attached simple csv-file. What am I doing wrong? I'm on Concrete5 version 5.6.1.

Thank you an regards from wintery Switzerland
Jürg

1 Attachment

Type: Discussion
Status: New
Juerg
View Replies:
jshannon replied on at Permalink Reply 2 Attachments
jshannon
Gruezi.

This is an odd message. On my system, it's importing fine. (See the screenshot I've attached for what it should look like.)

Can you paste your environment info? (It's at /index.php/dashboard/system/environment/info/ .) That'll tell me what version of PHP, c5, etc you have.

Do normal uploads work fine? Can you upload e.g. an image via the file manager?

Also, I've created a new version of the add-on that prints out a slightly more informative error message. Can you please install it (by unzipping it and replacing the current /packages/lerteco_user_importer directory with the lerteco_user_importer directory in the zip file. If you try to run it again, you should get a new message.

Merci,
James
Juerg replied on at Permalink Reply
Juerg
Thank you for the quick response (an you even know Swiss German ;-).

I installed your new version and the error was still the same: "A valid file with a CSV extension was not uploaded".

I uploaded hundreds of files so far without problems. Where do you try to save the uploaded file? Maybe the file permissions are wrong at that place?

Here my environment:
# Version von concrete5
5.6.1

# concrete5-Pakete
Advanced Forms (1.9.1), Area Splitter (2.1), Automatic Email Obfuscator (1.2.3), Data Display (2.5.2), Designer Content (3.1.1), Dojo Folio Slider (1.5.1), EMail-Liste (2.39), Front End Uploader (1.4.0.1), Gallerific (1.1.7), Lerteco User Importer (1.2.1.1), List files from set (1.0.4), Magic Tabs (1.1.0.1), MindNet Browser Update Notification (1.1), Page Redirect (1.4), Page Selector Attribute (1.1), Popup Pro (1.6.5), Power Slider Lite (1.1.1), Print my page (1.0.3), Registrant Group (1.1), Sortable Fancybox Gallery (1.17), The Void theme (1.0), Whale Nivo Image Slider (1.0.3), WordPress for Concrete5 (1.6.0).

# concrete5-Overrides
blocks/home_pic_two_col, blocks/list_files_from_set, blocks/wordpress_entries, blocks/jl_magic_tabs, blocks/jb_gallerific, controllers/register.php, elements/profile, languages/de_DE, mail/validate_user_email.php, mail/forgot_password.php, single_pages/profile, single_pages/register.php, single_pages/login.php, themes/stami_theme

# Server-Software
Apache

# Server-API
apache2handler

# PHP-Version
5.3.21

# PHP-Erweiterungen
apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dbase, dom, ereg, exif, fileinfo, filter, ftp, gd, geoip, gettext, hash, iconv, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mhash, ming, mysql, mysqli, openssl, pcre, pdf, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, SQLite, sqlite3, standard, suhosin, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Guard Loader, zip, zlib.

# PHP-Einstellungen
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 50
max_input_nesting_level - 64
max_input_time - 300
max_input_vars - 1000
memory_limit - 128M
post_max_size - 50M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 50M
ldap.max_links - Unlimited
mysql.max_links - 50
mysql.max_persistent - 5
mysqli.max_links - 50
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH
suhosin.cookie.max_array_depth - 400
suhosin.cookie.max_array_index_length - 256
suhosin.cookie.max_name_length - 256
suhosin.cookie.max_totalname_length - 512
suhosin.cookie.max_value_length - 20000
suhosin.cookie.max_vars - 600
suhosin.executor.include.max_traversal - 0
suhosin.executor.max_depth - 300
suhosin.get.max_array_depth - 400
suhosin.get.max_array_index_length - 512
suhosin.get.max_name_length - 256
suhosin.get.max_totalname_length - 512
suhosin.get.max_value_length - 1024
suhosin.get.max_vars - 800
suhosin.log.phpscript.is_safe - Off
suhosin.memory_limit - 128M
suhosin.post.max_array_depth - 400
suhosin.post.max_array_index_length - 256
suhosin.post.max_name_length - 256
suhosin.post.max_totalname_length - 512
suhosin.post.max_value_length - 1000000
suhosin.post.max_vars - 800
suhosin.request.max_array_depth - 50
suhosin.request.max_array_index_length - 256
suhosin.request.max_totalname_length - 512
suhosin.request.max_value_length - 1000000
suhosin.request.max_varname_length - 256
suhosin.request.max_vars - 800
suhosin.session.max_id_length - 128
suhosin.upload.max_uploads - 300

Jürg
jshannon replied on at Permalink Reply
jshannon
Hi...

I used to live in Genf. I miss wintery CH!

Did you run the environment variables before or after installing my update? I notice that the version is not the new one.

There's one possible thing left that wouldn't generate a different error message (due to, yes, file permisssions). However, it should be generating a very obvious PHP error message. Have you checked those?

In the meantime, I'm going to assume that's the problem and work on a fix.

James
Juerg replied on at Permalink Reply
Juerg
Your right. I forgot to install it via dashboard. Now it's version 1.2.1.2. The error is unfortunately still the same :-(.
Juerg replied on at Permalink Reply
Juerg
Hi James

I juste replaced the line in your luiusersfile.php:
$file = tempnam(DIR_TMP, 'lui');
with
$file = tempnam('/is/htdocs/wp11106250_5RSIYWOX8W/www/stami/files/incoming', 'lui');

Now it works. So there seems to be a problem with permissions somehow.

So, you can take your time since there is a quick and dirty solution for me now.

Thanks
Jürg
jshannon replied on at Permalink Reply 1 Attachment
jshannon
Good to hear. I hope everything else is working fine now.

I just found out that DIR_TMP was removed in recent versions of concrete5. In previous versions, it resolved to basically the same diretory that you hardcoded in. For most people, this doesn't matter, because their permissions aren't quite as strict.

Can you replace the luiusers.php file with the one attached (remove the .txt extension first) and tell me how it works?

Merci,
James
Juerg replied on at Permalink Reply
Juerg
Yes, now it's working. Cool :-).

BTW, while were at it: How do I import a value into a checkbox attribute? What's the format?
jshannon replied on at Permalink Reply
jshannon
Good to hear.

It's basically PHP's "truthy" format. [blank] and 0 are false (unchecked), anything else is true (checked).

James
Juerg replied on at Permalink Reply
Juerg
It turns out "0" doesn't uncheck but let's the value un-set, which seems to replace it with the default value which is true in my case.

Well, I guess I can live with it for my case.

Thanks for your speedy and competent help. I really appreciate it :-).

Have a good time and keep up the good work.
Jürg
jshannon replied on at Permalink Reply
jshannon
That doesn't make much sense to me. I'm looking at the checkbox (boolean attribute)'s code:

// run when we call setAttribute(), instead of saving through the UI
   public function saveValue($value) {
      $db = Loader::db();
      $value = ($value == false || $value == '0') ? 0 : 1;
      $db->Replace('atBoolean', array('avID' => $this->getAttributeValueID(), 'value' => $value), 'avID', true);
   }


So, it's basically providing 0 (if $value == false, which is 0 or [blank]) to the db... I know I use [blank] in my use. Not sure where the unsetting could come in....

Thanks for the review.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.