Ticket #240 (new patch)

Opened 1 year ago

Last modified 7 months ago

Enable users to substitute and overwrite an existing file

Reported by: ewout Assigned to: nobody
Priority: normal Milestone: 0.9.3
Component: core Version: 0.9.0
Severity: normal Keywords: files
Cc: rho, misja, dramirez, timh Patch Included: 1
Review Stage: accepted

Description

This patch adresses what I think is a common use case: someone want the change an already uploaded file, but want to keep the same URL pointing to it. It adds a checkbox (enabled by default, changing existing behavior) which enables the substitution of files.

Files are now put in $CFG->dirroot/files/first-character-of-name/name/subdir-id/ so that files of the same name can be in different subdirectories.

If the substitute checkbox is not checked, the upload library chooses another name for the files (putting _1, _2 etc after the original name).

The patch also constructs the url in a different way: instead of using $file->originalname, it uses basename($file->location)) everywhere.

Attachments

substitute_files.diff (13.8 kB) - added by ewout on 12/25/07 11:56:22.

Change History

12/25/07 11:56:22 changed by ewout

  • attachment substitute_files.diff added.

01/25/08 13:48:32 changed by ewout

  • status changed from new to assigned.
  • haspatch set to 1.
  • review_stage set to accepted.

If there are objections, I would like to check this in for 1.0 . Please test.

03/13/08 11:26:31 changed by

  • milestone deleted.

Milestone 1.0 deleted

03/13/08 11:33:14 changed by misja

  • milestone set to 0.9.3.

05/13/08 16:29:13 changed by ewout

  • owner changed from ewout to nobody.
  • status changed from assigned to new.