Add a text box for holding the file name that the upload was stored as on the server.
This commit is contained in:
parent
898337c033
commit
f4d271afb2
2 changed files with 6 additions and 3 deletions
|
@ -7,12 +7,12 @@ $(function(){
|
|||
paramname:'image',
|
||||
|
||||
maxfiles: 5,
|
||||
queuefiles: 1,
|
||||
maxfilesize: 10,
|
||||
url: 'upload.php',
|
||||
|
||||
uploadFinished:function(i,file,response){
|
||||
$.data(file).addClass('done');
|
||||
$.data(file).find('.linkBox').val(response.file);
|
||||
// response is the JSON object that post_file.php returns
|
||||
},
|
||||
|
||||
|
@ -61,13 +61,16 @@ $(function(){
|
|||
'<div class="progressHolder">' +
|
||||
'<div class="progress"></div>' +
|
||||
'</div>' +
|
||||
'<div class="linkHolder">' +
|
||||
'<input type="text" class="linkBox" />' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
|
||||
function createImage(file){
|
||||
|
||||
var preview = $(template),
|
||||
image = $('img', preview);
|
||||
image = $('img', preview);
|
||||
|
||||
var reader = new FileReader();
|
||||
|
||||
|
|
|
@ -17,5 +17,5 @@ if(array_key_exists('image', $_FILES)) {
|
|||
move_uploaded_file($file['tmp_name'], UPLOADS . $file['name']);
|
||||
}
|
||||
|
||||
echo json_encode(array('status'=>'Uploaded successfully'));
|
||||
echo json_encode(array('status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . UPLOADS . $file['name']));
|
||||
?>
|
Loading…
Reference in a new issue