473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Upload file size

Hello,

Is there a way to determine the size of a file in InputFile control
before it starts uploading(i.e.: wants to determine the file size at
client-side)?

The checking cannot be done on server-side because we'll have to wait
the HttpRequest stream transfer complete before the program starts to run.
We cannot limit the filesize by setting maxRequestLength because there'll be
more than one upload at a time. We've tried to add a hidden control with
name="MAX_FILE_SIZE" immediately after the form tag and found it not
working(at least in IE6SP1 I'm using, do I need to add one for each upload
control?)

I know that there's a method which use javascript to open the file and
gather the filesize information before it starts to upload, but since I do
not have the digitial certificate to sign the script, this is not possible
for me.

Is there such way without signing codes works? Thanks a lot.

Regards,
Lau Lei Cheong

--
If you want to mail to me, please replace all instance of "e" to "a" in my
email address. Thank you.
Sorry for any inconvience caused, but I there's many spam-mailers.

Nov 18 '05 #1
2 1304
It must be done on the client. Therefore, you will need a client-side app
(JavaScript, Java Applet, ActiveX Control, etc) to do the work.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:#d**************@TK2MSFTNGP10.phx.gbl...
Hello,

Is there a way to determine the size of a file in InputFile control
before it starts uploading(i.e.: wants to determine the file size at
client-side)?

The checking cannot be done on server-side because we'll have to wait
the HttpRequest stream transfer complete before the program starts to run.
We cannot limit the filesize by setting maxRequestLength because there'll be more than one upload at a time. We've tried to add a hidden control with
name="MAX_FILE_SIZE" immediately after the form tag and found it not
working(at least in IE6SP1 I'm using, do I need to add one for each upload
control?)

I know that there's a method which use javascript to open the file and
gather the filesize information before it starts to upload, but since I do
not have the digitial certificate to sign the script, this is not possible
for me.

Is there such way without signing codes works? Thanks a lot.

Regards,
Lau Lei Cheong

--
If you want to mail to me, please replace all instance of "e" to "a" in my
email address. Thank you.
Sorry for any inconvience caused, but I there's many spam-mailers.

Nov 18 '05 #2
There is no built-in way to do this.
There is a very long thread out there somewhere which discusses this issue
in detail.
It lasted for about a year.
As I recall, they posted 90% of the code required to do this and then sold
it to a 3rd party company.
So now you can buy the functionality (it isn't free)

It involved writing an HTTP Handler (I think).
Then you gain complete control over the request and can check file size and
use progress bars.
--
Joe Fallon

"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Is there a way to determine the size of a file in InputFile control
before it starts uploading(i.e.: wants to determine the file size at
client-side)?

The checking cannot be done on server-side because we'll have to wait
the HttpRequest stream transfer complete before the program starts to run.
We cannot limit the filesize by setting maxRequestLength because there'll be more than one upload at a time. We've tried to add a hidden control with
name="MAX_FILE_SIZE" immediately after the form tag and found it not
working(at least in IE6SP1 I'm using, do I need to add one for each upload
control?)

I know that there's a method which use javascript to open the file and
gather the filesize information before it starts to upload, but since I do
not have the digitial certificate to sign the script, this is not possible
for me.

Is there such way without signing codes works? Thanks a lot.

Regards,
Lau Lei Cheong

--
If you want to mail to me, please replace all instance of "e" to "a" in my
email address. Thank you.
Sorry for any inconvience caused, but I there's many spam-mailers.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
0
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
2
by: Event Horizon | last post by:
Hi, I'm trying to add an simple upload applet to shopping cart script. My new applet form sends all needed post fields ( quantity, product, etc... ) but the "file" post field is hardcoded in...
2
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.