Skip to content

Commit

Permalink
modify upload.php for multipart/form-data
Browse files Browse the repository at this point in the history
upload.php を multipart/form-data 形式でアップロードされた
ファイルを扱えるように修正した。
  • Loading branch information
okura3 committed Aug 19, 2011
1 parent 38f41f0 commit 999ed81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion droparea.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
xhr.setRequestHeader('x-param-'+i, area.data(i));

var fd = new FormData();
fd.append("filename", file);
fd.append("x-file-name", file);
xhr.send(fd);
}
};
Expand Down
2 changes: 1 addition & 1 deletion upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
. '.' . $headers['x-param-type'];
}
// Uploaded file source
$source = file_get_contents('php://input');
$source = file_get_contents($_FILES["x-file-name"]["tmp_name"]);
// Image resize
imageresize($source, $filename,
$headers['x-param-width'],
Expand Down

0 comments on commit 999ed81

Please sign in to comment.