This module uploads a zip of images, files or documents etc. and extracts them to a desired directory. Location of directory can be configured through modules admin configurations.
There are certain situations where a user would require a bulk of files to be
uploaded at server. You can take an example of feed import activity where a user
uploads node using feed importer. There could be an image or file field which
requires files to be uploaded however there is no simple way to move all files
via FTP first and then refer the path of uploaded files in your CSV or excel
files for a specific node to be created.
By using Pack & Upload this process can be very easy just by following the
steps:
1. Create a tar.gz or zip of files you want to upload.
2. Change pack & upload settings and specify a directory where you want to
move all uploaded files.
3. Now go to uploader form, provide path to your pack (zip or tar.gz) and
upload.
4. Once uploading is completed it will extract all files in the specified
directory.
Note: Make sure you have the right permissions to the directory where you want
to upload.
Sandbox Link:
https://drupal.org/sandbox/divesh.kumar/2091701
GIT URL:
git clone --branch 7.x.1.x divesh.kumar@git.drupal.org:sandbox/divesh.kumar/2091701.git pack___upload
Reviews of Other Projects
https://drupal.org/node/2043615#comment-7653461
https://drupal.org/comment/8375895#comment-8375895
https://drupal.org/comment/8384045#comment-8384045
Comment | File | Size | Author |
---|---|---|---|
#3 | pack_upload_help.png | 11.38 KB | stockunlocks |
Comments
Comment #1
divesh.kumar CreditAttribution: divesh.kumar commentedComment #2
PA robot CreditAttribution: PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
stockunlocks CreditAttribution: stockunlocks commentedHi divesh.kumar:
I'm using Drupal 7.23 and I've installed the module and it works as described.
I just wanted to bring a couple of things to your attention:
First: Like most users, I skimmed over the instructions and jumped right in. I went to the configuration page and saw that the "SETTINGS" tab already had the Bulk Media Extraction Path set to:
sites/default/files/bulk_media
So, I skipped clicking "Save configuration" and went directly to the "UPLOAD BULK MEDIA" tab. I browsed for my .zip package and clicked "Submit".The package was uploaded, but not expanded. It was placed as a .zip in the
sites/default/files
folder instead of where I thought it would go.I went back to the "SETTINGS" tab and this time clicked "Save configuration" and was presented with the confirmation message. Going through all of the motions again were successful: .zip uploaded and expanded in the
sites/default/files/bulk_media
where it should have been.As a small suggestion: Why not disable the "Submit" button if the Media Extraction Path has not been set? You could present a message instead of the Submit button, like: "Please set: Bulk Media Extraction Path first" or something like that. This would prevent orphaned package files from being dumped onto the server.
It is a nice idea to have the path already there, as you have it. No need to guess how it should be formatted if a custom path was desired.
Second: When navigating to
/admin/advanced_help/pack_upload
, the title of the page is formatted like this:Pack & Upload help index
all other pages like this:Pack & Upload
. Just a small fix needed. I've included a screenshot below.Thanks
Comment #4
divesh.kumar CreditAttribution: divesh.kumar commentedHi darrel,
I have made the changes to default media path and the bug is fixed also made the changes to the title as well.
Thanks
Comment #5
pgautam CreditAttribution: pgautam commentedHi Divesh,
.module file
- remove MENU_NORMAL_ITEM as this is default in drupal 7.
Rest seems fine to me.
Thanks,
Paritosh Gautam
Comment #6
Nitesh Pawar CreditAttribution: Nitesh Pawar commentedHi divesh.kumar
I think you need to create directory by code, But its my thinking if you like then you can use this patch. :-)
Thanks
Comment #7
Ravi.J CreditAttribution: Ravi.J commentedHi Divesh,
Couple of points
From the inspiration of project
Does the module do this now, i.e log the list of files uploaded somewhere so that the list can be used for creating nodes etc ?
Comment #8
divesh.kumar CreditAttribution: divesh.kumar commentedHi Ravi,
Thanks for being taking my contribution into consideration and I really appreciate your time to review this request.
I am aware with the file_entity and I know by making few changes this can be achieved however there could be some scenario where you would require a utility which just takes your package and extracts everything at right place.
Lets take an example there could be a scenario when a person completely wants to move media files to files directory and doesn't have ftp accessibility then my this utility would work for him.
Though its really beneficial in feeds scenario because there no such effective way when you import csv file and if a media is related to a node record there could be problem attaching the image once again.
I know this would be another module to the community however there are plenty of them which does a very small task, btw rounded corner js was one of them.
I would need your help to provide this utility to community.
Thanks
Divesh Kumar
Comment #9
divesh.kumar CreditAttribution: divesh.kumar commentedComment #10
ram4nd CreditAttribution: ram4nd commentedComment #11
klausi@ram4nd: you don't need to predefine arrays before using them in PHP, so the hook_menu() implementation is fine. Make sure to verify that a PHP notice actually exists before reporting it next time.
Comment #12
ram4nd CreditAttribution: ram4nd commentedOk, I have experienced notices when I don't predefine them in PHP 5. Although I don't remember the case. Also other people have told me so.
Comment #13
brockfanning CreditAttribution: brockfanning commentedHi Divesh, I tried out the module, and here is some feedback:
If you could shed any light on the error, I'll give it another try. Thanks!
Comment #14
m1n0 CreditAttribution: m1n0 commentedComment #15
divesh.kumar CreditAttribution: divesh.kumar commentedHi brockfanning,
Can you please let me know on which case you are getting the upload error as I had tested it on multiple system by changing the permissions and it went well.
And definitely this is useful functionality for users as well and the auto extraction is too a wonderful thoughts which I will definitely include in future release after the initial release.
Thanks
Comment #16
brockfanning CreditAttribution: brockfanning commentedHi Divesh, I'm still having the same problem. Here are some details on what I'm doing:
- new Drupal 7 install
- created files directory, chmod 777
- enable pack_upload
- go to upload form, attempt to upload a .zip file, get the same error
- tried saving the config page first, but same result
- tried chmod 777 the bulk_media folder (which the module created for me), same results
- tried uploading an image file on a new node of the "article" content type to make sure that worked, and it did
Here's the error message:
File temporary://pack_upload.zip (/tmp/pack_upload.zip) could not be moved, because the destination sites/default/files/bulk_media is invalid. This may be caused by improper use of file_move() or a missing stream wrapper.
More info:
The files are being uploaded/saved to /tmp but not moved. Environment is Ubuntu 13.10, site is running on Apache 2 using virtual host. The zip file I used is created with the normal Ubuntu "compress" utility.
Hope this helps! Let me know if I should try anything different, or am doing something wrong.
Comment #17
divesh.kumar CreditAttribution: divesh.kumar commentedComment #18
klausiIt appears you are working in the "7.x.1.x" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
So the branch name should be "7.x-1.x", not "7.x.1.x".
manual review:
But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to patrickd as he might have time to take a final look at this.
Comment #19
divesh.kumar CreditAttribution: divesh.kumar commentedHi Klausi,
Here are my comments.
@Brockfanning, Thanks man for consistently helping in testing the module. The file upload should not be a problem now. please check and confirm.
Thanks
Comment #20
patrickd CreditAttribution: patrickd commentedSorry for the delay;
I'd recommend you to make the first sentence of your project page a short introduction to what it does, big blocks of text are no good for people who just want to quickly understand what it does and whether they can use it.
(if possible:) when the extraction of a zipfile fails it might be useful if you log some details with watchdog(), just the general error message wont help the maintainer much for fixing the problem.
No critical issues though,
Thanks for your contribution!!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #21
patrickd CreditAttribution: patrickd commentedwoops
Comment #22
brockfanning CreditAttribution: brockfanning commentedDivesh, I'm still getting the same error. I'm wondering if maybe it's a PHP version issue, as I just noticed that Ubuntu has me at PHP 5.5.3.
- EDIT: Given that nobody else is experiencing this problem, I think it's safe to say it's something specific to my setup. I'll shut up now. :)
Comment #23
divesh.kumar CreditAttribution: divesh.kumar commentedComment #24
divesh.kumar CreditAttribution: divesh.kumar commentedHi Brockfanning,
Thanks man for your effort in testing. Somehow I am not able to get that error. May be your machine is not happy with you :-P.
Anyways you have been such a great help in getting this module bug free.
Much appreciated!!!
@patrickd, I have made a watchdog logging as suggested.