Home arrow FAQ arrow Remository uploads arrow Add files already on the server
Add files already on the server
Contributed by Administrator   
Feb 25, 2008 at 03:43 PM

With the release of Remository 3.43 (initially for Joomla 1.5 with the Mambo/Joomla 1.0.x version to follow soon) the facilities for adding a number of files into the repository are simplified and extended. This applies to files that are somehow already present on the server, whether by FTP, direct copying or whatever. To become part of the Remository repository, these files have to be processed so that entries can be made in the database tables.

The old "Bulk add files from server" has been removed and the "Add whole structure from server" changed to "Add files already on server". So there is now only one facility for adding files in quantity. Remember that this facility only adds the bare minimum of information into the repository, since there is no way to generate things like descriptions. So you may need to do additional work to develop your repository if it is to contain more than the minimum of information.

Please note that this is a complex operation, especially for a substantial structure of files. If you are not expert in handling files on a Linux system, you may need professional assistance to succeed. There can always be bugs in Remository, but most claims for this process not working turn out to be nothing to do with Remository, once investigated.

In all cases, you first need to make sure you have a container into which the files are to go. If it does not already exist, then create it using the standard Remository administrator facility "Manage containers". Make sure that it is configured how you want - in particular, make sure that if you want the files to be stored in the database the "absolute path" is empty. Conversely, if you want the files to be stored in the file system, make sure that there is a valid absolute path specified in the container. THIS IS IMPORTANT. If you are not sure what an absolute path is, ask your host or look on the web (for example you could consult http://www.computerhope.com/jargon/a/absopath.htm. Note that what is needed is an absolute path in the file system, not a URI with absolute path, so it might look something like /home/myname/mydomain.com/downloads. NOTE The absolute path does NOT need to be within the same directory as your web documents, such as the basic index.php belonging to Mambo/Joomla; it is better to store files for the repository outside this directory structure. Again, if in doubt refer to your web host or if you want custom services, contact us.

When you go to add files, you will have to choose the container. Then you need to give the absolute path to the files you want to add. This need not be the same as the absolute path (if any) used in the container. Remository will move files if necessary. Any files that are in the directory specified will be put into the chosen container.

CRITICALLY IMPORTANT NOTE: For this operation, Remository aims to remove the files that are being imported, and place them into the repository, wherever that is located. In practice, this means that what will normally happen is actually a rename of the file (which can include a change to the whole path, not just the file name). This will FAIL if the files do not have suitable ownership and permissions for Remository to be able to do this. Moving the files is important for two reasons. One is saving space and one is speed of operation. PHP scripts typically have short time limits, and renaming is far faster than copying. If you want to preserve the original file structure, then make a copy of it for Remository's use, and make sure to set permissions so that Remository can rename the files.

For large volumes of files intended to go into the database, because of the factors above, it may be better to first import the files into the file system and then alter the containers to subsequently move the files into the database.

You will also be asked to choose from a set of three radio buttons. The options available are:

  • Only add files in the specified directory. Any subdirectories of the given directory will be ignored. One possible use for this is to load files into an existing area within the repository that you want added to the repository.
  • Add files in the specified directory only and also add any directories found in the specified directory. This is a useful option if you want to add a large structure into the repository, but do the addition only a stage at a time. The subdirectories will be used to create new containers as children of the container that you chose for the whole operation. The new containers will have the names of the subdirectories. The new containers will store data in the database if the original container did so. They will store data in the file system if the original container did so.
  • Add files in the specified directory and all subdirectories to whatever depth is found. Remository will create new containers as necessary to incorporate the whole directory structure (starting at the specified directory) into the repository.

When looking for files to add to the repository, Remository will always check whether a file is already part of the repository. If it is, then the file will not be added again. So it is possible to run this service against a directory that is already part of the repository and have only new files added.

Be careful to enter something in the extensions input field. Remository takes account of this in conjunction with the list of extensions specified in the configuration (through the administrator interface). It is not possible to add a file that is not included in the list of extensions in the configuration. If you want to include any extension that is in the list, you can enter * in the add files screen. Or if you want to be more selective, you can enter a comma separated list of extensions.

PLEASE NOTE: In all cases where files are stored in the file system, the names will currently be changed by inserting the unique file ID for the repository between the file extension and the rest of the name. This is essential to support those users who wish to have multiple files of the same name within a single repository. When time permits, Remository will be provided with an export facility.

Last Updated ( Jun 06, 2009 at 03:32 PM )
Next>

Login

Real Time Web Analytics