Bulk Importer
This is an open discussion with 38 replies, filed under Extensions.
Search
Fantastic!
Sweet.
Sweet!
I was literally minutes away from writing an extension like this. Except I was looking for import of a folder which I uploaded through FTP before (not zipped). Looking at your code, it seems easy to hook a similar functionality in.
Would you work on this? Otherwise I would try to edit your code to get this working.
@shorebreak, Nick Dunn has created an Upload Select Box that lets you select files from a folder, although this isn’t a mass import style it might help.
I’m fairly certain the BulkImporter will pick up the Upload Select Box, but it’d be a special case to check that if the field type was Upload Select Box and to modify the code around here
Great extension, simpified version of mass upload and works with subsection manager, just what I need.
One request:
- Is it possible to append and not replace the related entries when upload to an entry that already has values for their linked field?
One comment:
- I think this extension use a classes only available in php 5.3 (RecursiveDirectoryIterator), and use a the function in class.file.php (mimecontenttype) that is deprecated, I had some problems to make it works in my server.
Thanks for this extension.
It seems the zip doesn’t get extracted. It is moved to the target path but that’s it. Also after hitting import all I get is an empty page. Issue
Updated the PHP version and zip extraction is working now (PHP 5.3.2). But still I wasn’t successful importing a zip of jpegs into the dummy symphony setup.
all I get is an empty page
Have you enabled the display of PHP errors? In your .htaccess file add
php_flag display_errors on
And it should give you the actual error rather than a blank page.
@nick THANKS!
So I get this error:
Fatal error: Call to a member function get() on a non-object in /..../bulkimporter/extension.driver.php on line 254
$fields seems to be an Array not an Object?!
Bulk Importer
updated to version 0.9.1
on 15th of November 2010
Fixes
- Allows you to upload images to a section that has no name field
- When associating to a linked entry, it will now append instead of erasing all currently linked values
- Better error checking
It tells me my uploads fail. 15th Nov, 2010 at 06:19pm :: Datei :: 0 uploaded :: 2 failed
Although the files get extracted and moved but the DB is not altered it seems. I’m doing this on the default Symphony 2.1.2.
This is with your 0.9.1 build.
Does it have any dependencies that I am missing?
No dependancies, see the Supported Fields section.
Can you post the details of the section you are trying to import into and some details of the files?
Here is what I did: a fresh symphony installation. latest bulk importer.
create a section:
Goto Bulkimporter and upload this zip file:
Which gives me this:
The ZIP will get extracted and the files are moved:
But not all of them are added:
Before I always got this: Files were extracted but not inserted into the db.
This is written in the main log file in the manifest part of the symphony installation (4 times for the amount of files in the zip):
2010/11/17 16:16:38 > WARNING: 2 - mkdir() [<a href='function.mkdir'>function.mkdir</a>]: File exists in file /Sites/test/symphony/lib/toolkit/class.general.php on line 392
Thanks for this @shorebreak. I’ll take a look today on my lunch break (~4hours away)
I was able to reproduce this and the internal error from the field was:
- A file with the name adaptor_small.png already exists in /workspace/uploads. Please rename the file first, or choose another.
- A file with the name arrow_down.png already exists in /workspace/uploads. Please rename the file first, or choose another.
- A file with the name arrow_right.png already exists in /workspace/uploads. Please rename the file first, or choose another.
- A file with the name download_small.png already exists in /workspace/uploads. Please rename the file first, or choose another.
- A file with the name information.png already exists in /workspace/uploads. Please rename the file first, or choose another.
I will be looking at updating the extension to make these errors visible to the user.
Cool! Error output would help for sure. Are these logged somewhere so I can have a look at them? I just have the feeling that it occurs even if the file does not exist already. It’s a little mysterious to me. :)
Thanks for your help!
No these currently aren’t logged anywhere. If your happy to get your hands dirty you can do this:
extension.driver.php
- Line 220 add
$upload_errors = array();
Line 295-6 change to:
if(__ENTRY_FIELD_ERROR__ == $entry->checkPostData($_data,$errors)) { $upload_errors[] = $errors[key($errors)]; continue; }
Then before the // Set the Section Association
add:
if(!empty($upload_errors)) {
return $upload_errors;
}
It’s not elegant, but it’ll give you the errors.
received this when uploading a zip:
Fatal error: Undefined class constant 'SKIP_DOTS' in /home/laurawei/public_html/extensions/bulkimporter/extension.driver.php on line 103
what other information do you need for this? should i add an issue to the tracker?
What version of PHP are you running? I believe I’ve used a function in here that’s only in PHP5.3
Create an account or sign in to comment.
A new extension, “Bulk Importer” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.
Some may remember this extension from 2009, it’s back and it’s a wee bit more flexible.
Bulk Importer
The Bulk Importer allows you to upload a zip archive of files to Symphony. The extracted files are injected into a chosen section into an upload field. The name of the file is added to the first instance of a “text input” style field. Optionally, you can link the newly imported entries to another entry using either the Select Box Link, Reference Link or Subsection Manager extensions.
INSTALLATION
USAGE
USE CASE
I have an Images section (Name - Textbox, Upload - Upload) and a Gallery section (Name - Textbox, Related Images - Subsection Manager). I choose the Images section and then the Upload field to import the files into. I then choose the Gallery: Related Images section link and the entry named ‘My Test Album’. Clicking the ‘import’ button will upload the zip file, extract the files and then import them to the Images section. It will also associate these entries in the Images section with the ‘My Test Album’ entry in the Gallery section.
SUPPORTED FIELDS
Upload fields
Any extension that matches the /upload/i regex (which is all known to date).
Text Input fields
The textbox field extension and the core text input field are supported.
Section Link fields
The Selectbox Link, Reference Link and Subsection Manager extensions.