File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # Change Log
2+ All notable changes to this project will be documented in this file.
3+ This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
4+
5+ ## [ Unreleased]
6+ ### Added
7+ - This CHANGELOG file.
8+
9+ ### Changed
10+ - Handle duplicate files in the same way as the Python implementation, adding
11+ the new 409 response code from API v2.
12+
13+ ## 1.0.0-rc.1 - 2015-11-03
14+ ### Added
15+ - The server implementation all packed in a single file.
16+ - Documentation to help people get started.
17+
18+ [ Unreleased ] : https://github.com/PhotoBackup/server-php/compare/v1.0.0-rc.1...HEAD
Original file line number Diff line number Diff line change 127127$ filename = preg_replace ('@[^0-9a-z._-]@i ' , '' , $ filename );
128128$ target = $ MediaRoot . '/ ' . $ filename ;
129129
130+ /**
131+ * If a file with the same name and size exists, treat the new upload as a
132+ * duplicate and exit.
133+ */
134+ if (
135+ file_exists ($ target ) &&
136+ filesize () === $ _POST ['filesize ' ]
137+ ) {
138+ header ($ protocol . ' 409 Conflict ' );
139+ exit ();
140+ }
141+
130142/**
131143 * Move the uploaded file into the target directory. If anything did not work,
132144 * exit with HTTP code 500.
You can’t perform that action at this time.
0 commit comments