0

How to get file size before uploading

asked 2014-02-25 10:27:09 +0800

yasinsahin gravatar image yasinsahin
6

Hi,

I am trying to upload file(s) to Amason S3 directly because of network traffic limitations. I need to know exact byte size of the file(s) to interrupt caching ( When uploading directly from an input stream, content length must be specified before data can be uploaded to Amazon S3. If not provided, the library will have to buffer the contents of the input stream in order to calculate it ).

Pure Javascript and html provides us that with <input type = "file" onchange="function(this)">. How can I get length of file(s) before reading/converting inputstream. Or how can I use native input component to manage my uploads easily.

Thanks.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-02-25 12:34:26 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Well I don't know if this can be usefull :

<button label="Upload Image" upload="true,maxsize=300">

or here (line 243) at githun i qoute :

If you want to customize the handling of the file upload at
the client, you can specify a JavaScript class when calling this method: <button upload="foo.Upload"/>

Hope this helped you out.

Greetz Chill.

link publish delete flag offensive edit
0

answered 2014-02-26 10:48:39 +0800

yasinsahin gravatar image yasinsahin
6

Well there is a solution at least.

Is there any sample usage for this solution. Actually I'm not good/experinced at JavaScript. This is why I am firstly trying to manage it by ZK. But if there is any sample to fit, I can handle it.

Thanks..

Yasin

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-02-25 10:27:09 +0800

Seen: 20 times

Last updated: Feb 26 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More