This is a migrated thread and some comments may be shown as answers.

Upload: Intercept and change files

1 Answer 120 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Thiam Chye
Top achievements
Rank 1
Thiam Chye asked on 14 Dec 2012, 09:39 AM
Hi there,

I have a rather weird requirement... currently we are using the upload widget, and is using it to upload zip files. The files can be huge, and a significant portion of the zip content can be discarded and not uploaded.

Thus I am wondering is there anyway for us to:
1.) intercept the upload widget just before it performs the upload
2.) retrieve the user selected files
3.) run it on a custom script which converts the zip files into the smaller desired file
4.) uploads these converted files instead

We are wondering whether is there any API or ways to perform steps 1,2 and 4 using the upload widget? Currently, I listened to upload event, which fulfills steps 1 and 2, but is unsure how we could achieve step 4. Thank you!

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 17 Dec 2012, 07:53 AM
Hello Thiam,

The described scenario is impossible to achieve with standard HTML and Javascript, due to the following restrictions:

2. Some browsers do not provide information about the file size on the client, so client validation is not always possible.
3. Javascript does not have access to the file system, so it cannot read existing files or save new ones.
4. Browsers can upload only files, which have been explicitly and manually selected by the user via the popup dialog.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Thiam Chye
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or