Closed (fixed)
Project:
Document Import API
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2008 at 05:37 UTC
Updated:
3 Sep 2008 at 04:42 UTC
Should the user's uid be part of the path to where the file is saved. This would prevent different users from overwriting eachother's files.
Comments
Comment #1
agentrickardOr, if we add UID to {docapi_library}, then we could check this during the upload sequence.
In that case, we could prompt the user for what to do -- with the default option being to rename the file. Note that upload.module silently renames files that already exist. (So you get mydoc.doc and mydoc_1.doc, mydoc_2.doc.)
So by default, just appending a version number should be the standard, I think.
Comment #2
bradfordcp commentedI added uid last night to {docapi_library}, should I append the doc_id to the filename? Possibly inserting the record into the db with the tmp path. Then after a doc_id is generated, move the file to the correct directory with the doc_id appended to it. From here we would simple update the db with the new path.
Comment #3
agentrickardd.o. appends a version id to the filename during the transfer from /temp to /files, based on the "overwrite file" setting.
You can lean on file_save_upload() for this.
See http://api.drupal.org/api/function/file_save_upload/6
For most of the file handling that you need to do, file.inc has functions that cover your needs.
Comment #4
bradfordcp commentedI think this has been fixed in the latest revision...
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.