Hello everyone, I would like to get the uploaded file name that change from the upload script file that is index.jsp. How can i get the changed file name. This code is working before changing file name in index.jsp. Now i change the upload file name as "name+currenttimeinmillisecond". The alert message box "alert("file name "+fileObj.name)" point the old file name before chaning. Thanks and regards, Yan
[CODE]
<%
String uploadIndexFile="/html/upload-index/indexprofile.jsp";
String uploadFileExtension=".png;.gif;*.jpg;";
String uploadifySwf = "/html/upload-index/uploadify.swf";
%>
" type="application/x-shockwave-flash" height="30" width="110"> &folder=photos&width=110&height=30&wmode=opaque&method=POST&queueSizeLimit=1&simUploadLimit=1&fileDesc=Video Files,jpg&fileExt=<%=uploadFileExtension %>&auto=true&sizeLimit=99819200&fileDataName=Filedata&queueID=fileQueue" name="flashvars">
jQuery(document).ready(function() {
var uploadFileName;
$(function() {
$("#uploadify").uploadify({
'onComplete' : function (event, queueID, fileObj, response, data) {
load(fileObj);
},
'onError' : function(event, queueID, fileObj, response, data){alert('error'+response);alert('error'+fileObj.name); }
});
});
function load(fileObj) {
alert("file name "+fileObj.name);
$('#image_container').empty();
var fileObjName = fileObj.name;
var uploadFileName=fileObj.name;
var imgPath = "/html/uploads/"+fileObj.name;
_imgContainer = $(document.createElement('img')).attr('src',imgPath).attr('id','cropbox');
$(".jcrop-holder").remove();
$('#uploadFileName').val(uploadFileName);
$('#image_container').append(_imgContainer);
$('#cropbox').fadeIn().Jcrop({
onChange: showPreview,
onSelect: showPreview,
aspectRatio: 1,
onSelect: updateCoords,
setSelect: [ 0, 0, 1200, 1200 ]
});
} });
[/CODE]