on 09-05-2007 10:21 AM
Hi Gurus,
i use in this time the fileupload UI element - after choosing a file I developed a upload action with following code:
byte[] file = element.getStorage_place();
double kb = file.length * 0.0009765625;
if(kb > 5000){
...Message...
}else{
}
The problem, i cann't calculate the size after uploading the file, which takes many minutes if you choose a file with a size over 10 MB.
To avoid the timeout, i like to determine the size before uploading - is there any possibility?
Thanks in advance Stefan
Hi Vito,
the problem, the ui elements returns only the filename - how can i get the directory?
Thanks Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan,
please check the API regarding IWDResource:
Note that you can use getUrl to get the URL, so also the directory.
Regards,
Vito
Thanks,
but we use NW2004 - so i can find the IWDResource. Any other ideas?
Thanks Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan
follow the blog Kanwalpreet indicated to you, that's cool. But if you want to ckeck the file size beforeupload use this code:
.....
f = new File(directory, filename); // Create a file object
in = new FileReader(f); // Create a char stream to read it
int size = (int) f.length(); // Check file size
if (......) //Here go ahead with your considerations regarding file size
.....
Thanks,
Vito
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.