Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Adams  
#1 Posted : Wednesday, March 4, 2015 7:31:50 PM(UTC)
Adams

Rank: Newbie

Groups: Member
Joined: 2/4/2015(UTC)
Posts: 9

If there is same filename on server, uploading process will rename and save as xxxxx_0.jpg .
How can I get the uploading target filename in function Uploader1_Progress(percent, uploadedFiles, totalFiles, uploadedBytes, totalBytes) or function Uploader1_AfterUpload(response) ?
thanks!

Code:
<script type="text/javascript">
function Uploader1_BeforeUpload(response){
}

function Uploader1_Progress(percent, uploadedFiles, totalFiles, uploadedBytes, totalBytes){
   fileName = $au.uploader('Uploader1').files().get(0).name();
   alert(fileName);
}

function Uploader1_AfterUpload(response){
   alert('ok!');
}
</script>

Edited by moderator Thursday, March 5, 2015 3:55:51 AM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Tuesday, July 28, 2015 10:04:28 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 868

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
Everything you send from the server (e.g. Response.Write in ASP.NET, echo in PHP, etc) you will get as a response parameter in AfterUpload. So you can use it to transmit the real file name to the client. Unfortunately, you cannot do it in the Progress event (because the server code is not executed there yet).
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.