Rank: Newbie
Groups: Member
Joined: 6/20/2011(UTC) Posts: 3
|
I am testing the HTML5 flash uploader in asp.net. One problem I have notice with this is that on fileuploaded event i cant fetch the dates from the file. I have tested e.UploadedFile.SourceLastModifiedDateTime; e.UploadedFile.SourceLastModifiedDateTimeLocal; e.UploadedFile.SourceCreatedDateTime; e.UploadedFile.SourceLastModifiedDateTimeLocal All I get is "0001-01-01 00:00:00" other arguments like e.UploadedFile.SourceName; is working correct Best Regards Erik
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
It looks HTML5 uploader does not send any date information. When it was originally created, only Flash could do it. Now, it is possible to grab the LastModified date from a JavaScript File API (no creation date though). If you send it as SourceLastModifiedDateTime_N to the server, the ASP.NET component should be able to pick it up. On a client side, you should add something like this: Code:
<script type="text/javascript">
function ImageUploaderFlash1_BeforePackageUpload(packageIndex){
var lastModified = this.files().get(0).file().lastModified;
// probably, you may need to format the date to YYYY:MM:DD hh:mm:ss format first
this.metadata().addCustomField("SourceLastModifiedDateTime_0", lastModified);
}
</script>
<aur:ImageUploaderFlash ID="ImageUploaderFlash1" runat="server">
<ClientEvents>
<aur:ClientEvent EventName="BeforePackageUpload" HandlerName="ImageUploaderFlash1_BeforePackageUpload" />
</ClientEvents>
</aur:ImageUploaderFlash>
I did not test this code, but it should give you the direction.
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 6/20/2011(UTC) Posts: 3
|
Hi again! I get the value undefined when trying to fetch the value set in javascript var lastModified = this.files().get(0).file().lastModified; If I change the value to var lastModified = Date.now(); I get different values every time. Erik
|
|
|
|
Rank: Newbie
Groups: Member
Joined: 6/20/2011(UTC) Posts: 3
|
If I use: this.files().get(packageIndex).modified(); I get the value null If i use : this.files().get(packageIndex).name(); I get the name of the file Erik
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration Joined: 8/2/2003(UTC) Posts: 876
Thanks: 2 times Was thanked: 27 time(s) in 27 post(s)
|
Erik, Are you using the latest version (8.5.67)?
|
|
|
|
Rank: Member
Groups: Joined: 4/12/2016(UTC) Posts: 12
Was thanked: 3 time(s) in 3 post(s)
|
Hello Erik What version of uploader do you use? I checked our current functionality, and all is working good. You can check this if you go to https://demo.aurigma.com...Apps/Basic/Default.aspx, choose a file, and run in a developer tools console command: Aurigma.ImageUploaderFlash.imageUploaderFlash('ctl00_content_Uploader1' ).files().get(0).modified(); Please download the latest version, if you have an old one. Best regards Alex Edited by user Monday, March 19, 2018 2:33:44 AM(UTC)
| Reason: Not specified
|
|
|
|
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.