CC-3086: When uploading a file to /tmp filename collisions can occur
- mktemp is used to generate temp name within /tmp dir - it generate temp file when the file gets uploade to /tmp and then copy to organize folder as original file name
This commit is contained in:
parent
37da2bf0c5
commit
ab0dc64ba9
4 changed files with 28 additions and 38 deletions
|
@ -16,16 +16,16 @@ $(document).ready(function() {
|
|||
|
||||
uploader.bind('FileUploaded', function(up, file, json) {
|
||||
var j = jQuery.parseJSON(json.response);
|
||||
|
||||
if(j.error !== undefined) {
|
||||
|
||||
|
||||
if(j.error !== undefined) {
|
||||
var row = $("<tr/>")
|
||||
.append('<td>' + file.name +'</td>')
|
||||
.append('<td>' + j.error.message + '</td>');
|
||||
|
||||
$("#plupload_error").find("table").append(row);
|
||||
}else{
|
||||
$.get('/Plupload/copyfile/format/json/name/'+encodeURIComponent(file.name), function(json){
|
||||
var tempFileName = j.tempfilepath;
|
||||
$.get('/Plupload/copyfile/format/json/name/'+encodeURIComponent(file.name)+'/tempname/'+encodeURIComponent(tempFileName), function(json){
|
||||
var jr = jQuery.parseJSON(json);
|
||||
if(jr.error !== undefined) {
|
||||
var row = $("<tr/>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue