Active
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2012 at 07:14 UTC
Updated:
22 Feb 2012 at 08:43 UTC
HI,
Can someone please help me to change the file storage path for all the files to be uploaded in future. I should be able to categorise files according to their format like images,videos,pdf,css,js etc. They respective files need to be saved in the respective folder.. please let me know the steps as soon as possible
Comments
Comment #1
jorgbert commentedThat is a rather broad request. It also depends on what File Browser you are using within your CKEditor module. I'll give you the example using the excellent CKFinder product. In CKEditor, you click on the image icon, select which brings up the CKFinder window, creates an images directory, and the upload images. Basket is a place to temporarily copy files to within CKFinder. If you want Flash then you click on the Flash icon in CKEditor to create a flash directory. If you want document management, eg PDFs, Docs, etc, just click on the hyperlink, select , and that will create a files directory.
In the CKEditor module config ( We DON'T use the WYSIWYG module because the ckeditor module gives us a lot more control over buttons, etc.) scroll down to "File Browser Settings". For File browser type, select CKFinder, Same as in the Link dialog window for Images and Flash. Under CKFinder settings we use "%bassets/" for the "Path to uploaded files" and "%d%bassets/" for the "Absolute path to uploaded files", since we want to store our assets in a directory immediately inside the web root (/assets), instead of way inside of /sites ...
So we end up with:
/assets/files
/assets/flash
/assets/images
Just create as many subdirectories inside of this for your content types if you want that type of granularity. I'm not sure why you wouldn't want to create subdirectories inside these types by topics, for example. Suppose you start out with a JPG, but then later upgrade that to a PNG. Why would you want to move the file to a totally different directory? Of course, maybe you have VERY unique use case.
You upload the appropriate content you specified above into the directory, "files" for documents, "flash" for Flash or "images" for images, or you can directly copy the files into your underlying file system directory. The paths we use above are all publicly accessible since we don't use the private file system for CKFinder storage. We actually use FileDepot for Document Management and it stores in the private directory you specify under Drupal "File System".
CKFinder is really great for corporate Intranet Group-based asset directories. We set up Drupal Team Sites similar to the way that SharePoint works, and give each Team Site their own website with CKFinder, FileDepot and Media to cover every type of file storage. CKFinder to publicly accessible directories is much, much faster than WebFM because the resulting file access from a web page doesn't go through the database. We found that cut response time from 1.7 seconds to 0.7 seconds!
Comment #2
mkesicki commented