Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Migrating a Site to Silverstripe

What you need to know when migrating your existing site to SilverStripe.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Bulk image uploading?


Reply

8 Posts   2382 Views

Avatar
Shauna G

13 February 2010 at 11:39am Community Member, 52 Posts

I'm migrating an established static site to SilverStripe and have a few hundred images that need to be added to the site. As they're also organized into various folders and subfolders, one could expect that going through and selecting them one by one to upload (since the upload interface in the CMS doesn't seem to allow for multiple selection) isn't really feasible. I tried simply copying them all to the assets/Uploads folder, but that seems to break the CMS (as in, it no longer displays the images section), so is there a way that I can do a batch upload of all these files?

I already looked at Cheese's bulk uploader module, but it doesn't appear to do what I need (it appears to tie the images to a page, I'm looking to upload all the images for the site to be placed on various pages). I also only really need this feature once, as the rest of the uploading should be with few enough images/files that it can be done using the default uploader.

Avatar
Willr

13 February 2010 at 1:03pm Forum Moderator, 5511 Posts

The admin assets section should support syncing with the filesystem. So uploading them to assets/Folder then visiting the asset admin it should like you tried, do it automatically for you so sounds like a possible bug. Couple things to try

* Make sure when you upload all the images you set the permissions to folder and its files to 775 or similar to make sure the permissions from wherever you moved them from are gone and they're readable, resizable by SS.

* Try uploading them in segments. 20 files at a time then viewing the cms. See if this works. If it works increase the amount of files...

* Try uploading them grouped in folders. Rather than 2000 files in 1 folder try 10 folders of 200 or something to help break it up. Goes hand in hand with point 1.

Since 2.4 automatic filesystem syncing has been turned off by default (due to performance issues) and has now been replaced by a button in the top left of the assets section to resync on demand.

Avatar
Shauna G

18 February 2010 at 6:37am (Last edited: 18 February 2010 7:01am), Community Member, 52 Posts

Worked great for files, but it doesn't seem to like subfolders. I even set everything to 775 (going so far as to check every single folder and make sure it was set to 775) and it still breaks admin/assets.

Avatar
Willr

18 February 2010 at 10:19pm Forum Moderator, 5511 Posts

ah its possible it doesn't like nested folders while importing. Haven't tested this myself but it might be something for an enhancement ticket on open.silverstripe.org.

Avatar
Shauna G

19 February 2010 at 3:05am (Last edited: 19 February 2010 8:12am), Community Member, 52 Posts

Do you think it would work if I created the folders from the CMS then upload the images into the folders? Some of them have quite a few images, so using the manual system would be rather cumbersome and time consuming (even more so than this workaround, if it works).

Oh, and an interesting thing that I don't think I have in the previous response -- the gallery module picks up the nested folders and can display them on the webpage, so the issue seems to be only in the assets section of the interface.

And....another side note... UncleCheese's ImageGallery (the newer, standalone module, not the Gallery extension) chokes as well. Only the "upload images" popup doesn't work on an Image Gallery Page in the CMS (everything else works). It just shows a blank Lightbox until I get rid of the nested folders. It's not really enough to file a bug report with him, especially as it's not really a bug with his module, but rather affects it because of how his module ties into the CMS. It might be worth giving him the head's up about, though. The bulk uploader that comes with it, though, provides a decent, albeit slow, workaround for the time being, however I think some better support for handling subfolders uploaded via FTP would still be beneficial.

Avatar
martimiz

6 May 2010 at 10:11pm Forum Moderator, 1092 Posts

Hi,
Hijacking this thread, sorry, but did you get any further on this? I'm working on an app where I need to import about 1000 images and link them to a list of products, imported from csv. I'm a bit worried about the import now (haven't got all the images yet). I'm using 2.4 and I've not found problems with nested folders just yet, but of course I'm testing with just a couple of images for now...

Avatar
Shauna G

7 May 2010 at 12:53am Community Member, 52 Posts

I haven't worked with SS in a while, so it's possible there have been updates. However, with the version I used in that project (info should be at the beginning or in one of my other threads, I haven't posted too much), I found that there is a specific naming standard that SS uses and the upload tool enforces. If I remember right, it strips out underscores (don't remember if it converts them to dashes or just strips them entirely) and probably spaces, but keeps dashes.

If you follow that naming standard, it seems it doesn't have problems taking uploads from outside the CMS (such as through FTP), and as long as the folders and the files follow that naming standard, it doesn't have problems with nested folders.

Avatar
martimiz

7 May 2010 at 1:44am Forum Moderator, 1092 Posts

Thanks :-) I'll go play with naming conventions for a bit and see what I can find. If need be, I can always just script my uploads right into the database, but it would be nice and comfortable to do it the SilverStripe way...