File Manager Storage Location
Permalink
Hey,
I am about to port an app to C5, there are a folder contains a lot of images that i want to port and use them at File Manager.
For this purpose, i copied them into files folder (/files/people/*.*), then wrote a code that get all images at this folder an add them to the file manager:
What this code does is to create a another folder for every file, and copy original one into new folder, so after running the code, i have thousands of folder.
What i want is to C5 use the original file located at /files/people/*.*
Is this possible? if so , how?
I am about to port an app to C5, there are a folder contains a lot of images that i want to port and use them at File Manager.
For this purpose, i copied them into files folder (/files/people/*.*), then wrote a code that get all images at this folder an add them to the file manager:
Loader::library("file/importer"); $fi = new FileImporter(); $newFile = $fi->import($pathToFile, $nameOfFile, $fileObject);
What this code does is to create a another folder for every file, and copy original one into new folder, so after running the code, i have thousands of folder.
What i want is to C5 use the original file located at /files/people/*.*
Is this possible? if so , how?
If you want to keep the files in files/people/, you can't have them in the file manager. So you need to trade off the advantages of keeping your existing structure vs the advantages of importing them into the file manager.
I was looking at the file related api at the Developer Index section and saw $f->setStorageLocation($item), So i thought it may has something to do with feature i want. So i suppose it's impossible and i should decide one way to another.
As far as I know that sets the location of the entire file manager system. Not just a single file.
Edit, thinking more, maybe I thought too fast. The name and interface suggests that maybe you can set the location for individual files. Whether you can set it outside of the file manager is another matter.
The file manager does more than just hash the locations of files. It also manages versions and associates versions with page versions.
Edit, thinking more, maybe I thought too fast. The name and interface suggests that maybe you can set the location for individual files. Whether you can set it outside of the file manager is another matter.
The file manager does more than just hash the locations of files. It also manages versions and associates versions with page versions.