Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 10
Product
FileUp
Version
all
Title
Saved File does not inherit File Permissions of Destination Directory
Problem
When saving an uploaded file, it does not inherit the file permissions of the destination directory.
Solution

During an upload, FileUp stores the partially uploaded file to a cache folder before saving it to its final upload location. The location of the cache folder is determined as follows:

  1. If using the HTTPModule for .NET uploads (v5 and above), the HKEY_LOCAL_MACHINE\SOFTWARE\Software Artisans\SA-FileUp\Parameters\FileUpTempDir registry key specifies the path.
  2. If using the ISAPI Filter (v4 and above), the HKEY_LOCAL_MACHINE\SOFTWARE\Software Artisans\SA-FileUp\Parameters\ISAPITempDir registry key specifies the path.
  3. Otherwise, the Path property is used to specify the path. If the Path property is not set, FileUp will use the WIN32 GetTempDir API call. The resultant cache file inherits the directory where it is created.

When the Save or SaveAs method is invoked, a new file is not actually created. Instead, the file is renamed from the cache directory/location to the destination directory. By renaming, the file permissions are not automatically updated.

To avoid this problem, there are a number of options:

  • Set the cache location to a different directory with the necessary permissions. You can also choose to use the same directory for caching and saving.
  • Modify the permissions of the current cache directory to match those of the final destination.
  • Set the cache directory to a different drive than the save directory. This will cause the file to be written again rather than just renamed. However, there will be a performance cost to this approach.
  • Finally, it is possible to set new file permissions after the upload is complete using .NET classes or SoftArtisans FileManager which is bundled with FileUp (See the permissions-related methods on the File object).

Related article: Where are the uploaded file's permissions inherited from?

Created : 10/23/2007 11:58:30 AM (last modified : 10/23/2007 11:58:29 AM)
Rate this article!
 
Comments