Fred, we have a situation where I have to import large chunk of data using CSVGrab. When entries are manually done we get below data which has its own format to hold data.
a:1:{i:0;a:4:{i:3;s:51:"test name1";i:5;s:8:"test phone1";i:1;s:11:"test email1";i:2;s:0:"";}}
a:1:{i:0;a:4:{i:3;s:60:"test name2";i:5;s:8:"test phone2";i:1;s:12:"test email2";i:2;s:0:"";}}
a:1:{i:0;a:4:{i:3;s:61:"test name3";i:5;s:8:"test phone3";i:1;s:5:"test email3";i:2;s:0:"";}}
Can you please explain how those variables are constructed? e.g. s:8, s:12, s:60 etc. is there a pattern?
@Cem This appears to be more of an FF Matrix question and not specific to the File fieldtype. However what you are seeing is a serialized array. You would need to serialize the data prior to inputting it into the DB. Since EE stores the matrix in one field a bit of magic needs to be done in order to reverse the process or directly store a new entry. I’m not very familiar with CSVGrab so not sure how this would work. Feel free to PM me if you’d like and I can try to help more if I can.
@Cem This appears to be more of an FF Matrix question and not specific to the File fieldtype. However what you are seeing is a serialized array. You would need to serialize the data prior to inputting it into the DB. Since EE stores the matrix in one field a bit of magic needs to be done in order to reverse the process or directly store a new entry. I’m not very familiar with CSVGrab so not sure how this would work. Feel free to PM me if you’d like and I can try to help more if I can.
I’ve just noticed that Fred and thank you for replying. As per your knowledge while creating nGen File Field, do you control some parts of data related to your field or is it purely FF Matrix that controls how data is constructed?
Hi there
When I upload a file that alredy exists, I get the following error:
Notice: Undefined offset: 1 in /home/xxx/public_html/backend/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 411
after that the stylesheet is out of place, but when I refresh everything is in place again. file uploaded, thumb created… it’s a minor bug, just to let you know…
cheers stefan
I needed to use this extension on a MSM enabled site, and found that in the custom field settings, it doesn’t denote which site you’re on for file upload destinations. I changed the select_upload_destinations function to the following to get Site labels. (i did not add any default settings however. I’ll polish it up and repost when I do that).
$dls = $DB->query("SELECT exp_upload_prefs.id, exp_upload_prefs.name, exp_sites.site_name, exp_sites.site_label, exp_sites.site_id FROM exp_upload_prefs, exp_sites WHERE exp_sites.site_id = exp_upload_prefs.site_id ORDER BY exp_sites.site_id, exp_upload_prefs.name ASC");
foreach($dls->result as $dl)
{
$selected = ($dl['id'] == $current_option) ? " selected=\"true\"" : "";
$block .= "<option value=\"{$dl['id']}\"$selected>{$dl['site_label']} - {$dl['name']}</option>";
}
New release v.0.9.5
http://www.ngenworks.com/software/ee/ngen-file-field/
• New feature: Select an existing file • Delete or de-associate: Now that you can use an existing file, you can either remove a file from the server (even if other entries use it) or just remove it from use with a particular entry via a new delete interface • MH File compatability: can now be a drop in replacement for single file uploads. NOTE! This will not work with fields that have multiple files uploaded. You will need to migrate those fields to an FF Matrix • File data is no longer stored as an array • Thumbnails are automatically create for use in the CP • “thumbs” directory under the upload directory for the field will be created to store the thumbnails • Image detection has been improved for thumbnail display - only GIF/JPG/PNG will show thumbnails
The new features are brilliant!
I’ve uploaded this to 2 different installs and seem to have some strange behavior. On one site which has both a FF Matrix field(w/nGen File) and a seperate nGen File Field, when I click “Use an Existing File” the link seems to jump to the top of the page, but nothing happens.
On the 2nd install, using just a FF Matrix(w/nGen File) the 1st row works perfectly. When I try to add a second row, I get the same behavior as above. If I fill in another field in the 2nd row and save, I can then use the nGen File’s “Use an Existing File” control. The options that pop up next to the trash icon (also really nice idea) also fail under the same conditions.
The new features are brilliant! I’ve uploaded this to 2 different installs and seem to have some strange behavior. On one site which has both a FF Matrix field(w/nGen File) and a seperate nGen File Field, when I click “Use an Existing File” the link seems to jump to the top of the page, but nothing happens. On the 2nd install, using just a FF Matrix(w/nGen File) the 1st row works perfectly. When I try to add a second row, I get the same behavior as above. If I fill in another field in the 2nd row and save, I can then use the nGen File’s “Use an Existing File” control. The options that pop up next to the trash icon (also really nice idea) also fail under the same conditions.
yes, if you want to choose an existing file within a matrix, you can only do it with the top row… but.. it’s working… hell yeah! woudn’t have thougth this possible… gREAT extension!!
Uaah.. and I get a line in the frontend for every entry I made:
Notice: Undefined index: file_name in /home/xxx/public_html/backend/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 556
how should I proceed when I have files thar are already uploaded? cheers stefan
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.