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

Notification

Icon
Error

Options
Go to last post Go to first unread
neran  
#1 Posted : Friday, March 9, 2018 2:28:09 AM(UTC)
neran

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

Andrew  
#2 Posted : Sunday, March 11, 2018 9:54:18 PM(UTC)
Andrew

Rank: Advanced Member

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

Thanks: 2 times
Was thanked: 26 time(s) in 26 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.

neran  
#3 Posted : Monday, March 12, 2018 7:17:41 AM(UTC)
neran

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

neran  
#4 Posted : Wednesday, March 14, 2018 2:33:03 AM(UTC)
neran

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

Andrew  
#5 Posted : Monday, March 19, 2018 2:23:14 AM(UTC)
Andrew

Rank: Advanced Member

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

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
Erik,

Are you using the latest version (8.5.67)?

Alex Nikulin  
#6 Posted : Monday, March 19, 2018 2:31:34 AM(UTC)
Alex Nikulin

Rank: Member

Groups: Member
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

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.