Merhaba arkadaşlar ücretsiz bir resim upload scripti indirdim. Ancak scriptte yüklenen dosyaların linkleri falan gösterilmiyor tek hazır olay resim klasöre eklenip önizleme oluşturuluyor anasayfada. Ben de resim upload edildiğinde önizlemenin altında input içinde resmin linki çıksın istedim ama beceremedim bir türlü. "e.target.result" yerine ne koyacağımı bulamadım. Yardım ederseniz sevinirim. Bu arada yanlış yerdeyse konu özür dilerim. gerekli kısımın başına ve sonuna // aaaaa ekledim kolay belirlenebilir olsun diye.

<script>
$(function(){

var dropbox = $('#dropbox'),
message = $('.message', dropbox);

dropbox.filedrop({
// The name of the $_FILES entry:
paramname:'pic',

maxfiles: 50,
maxfilesize: 10,
url: 'post_file.php',

uploadFinished:function(i,file,response){
$.data(file).addClass('done');
// response is the JSON object that post_file.php returns
},

error: function(err, file) {
switch(err) {
case 'BrowserNotSupported':
showMessage('Your browser does not support HTML5 file uploads!');
break;
case 'TooManyFiles':
alert('Too many files! Please select 50 at most! (configurable)');
break;
case 'FileTooLarge':
alert(file.name+' is too large! Please upload files up to 10mb (configurable).');
break;
default:
break;
}
},

// Called before each upload is started
beforeEach: function(file){
if(!file.type.match(/^image\//)){
alert('Only images are allowed!');

// Returning false will cause the
// file to be rejected
return false;
}
},

uploadStarted:function(i, file, len){
createImage(file);
},

progressUpdated: function(i, file, progress) {
$.data(file).find('.progress').width(progress);
}

});

var template = '
'+
''+
''+
''+
'
'+
'
'+
'
'+
'
'+
''+
'
';


function createImage(file){

var preview = $(template),
image = $('img', preview);

var reader = new FileReader();

image.width = 100;
image.height = 100;

reader.function(e){

// e.target.result holds the DataURL which
// can be used as a source of the image:

image.attr('src',e.target.result);
};

// Reading the file as a DataURL. When finished,
// this will trigger the onload function above:
reader.readAsDataURL(file);

message.hide();
preview.appendTo(dropbox);

// Associating a preview container
// with the file, using jQuery's $.data():

$.data(file,preview);

// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

var link = $(template),
input = $('input', preview);

var reader = new FileReader();


reader.function(e){

// e.target.result holds the DataURL which
// can be used as a source of the image:

input.attr('value',e.target.result);
};

// Reading the file as a DataURL. When finished,
// this will trigger the onload function above:
reader.readAsDataURL(file);

message.hide();
preview.appendTo(dropbox);

// Associating a preview container
// with the file, using jQuery's $.data():

$.data(file,preview);

// aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
}

function showMessage(msg){
message.html(msg);
}

}); </script>