473,402 Members | 2,046 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,402 software developers and data experts.

Capture data before file upload

I need to time a file upload using the 1.X HTML upload control. So I need
the time the upload started, which is problematic since no page processing
takes place until after the file is uploaded. Is there a way to write to the
form (lblUploadStartTime) before the upload begins using Javascript -- using
the OnClick of the Submit button? I'm not experienced with JS, so if there
is a way to do this please let me know the JS syntax.

Apr 13 '06 #1
2 1148
Server Side Code, In the Page_Load sub add this:
yourSubmitButton.Attributes.Add("onclick", "registerUploadTime();")

Client Side Code, Inside the head tag add this:
<script type="text/javascript">
function registerUploadTime()
{
document.getElementById('lblUploadStartTime').inne rText = Date();
}
</script>

"Chip" <ch**@intradata.com> wrote in message
news:ep**************@TK2MSFTNGP03.phx.gbl...
I need to time a file upload using the 1.X HTML upload control. So I need
the time the upload started, which is problematic since no page processing
takes place until after the file is uploaded. Is there a way to write to
the form (lblUploadStartTime) before the upload begins using Javascript --
using the OnClick of the Submit button? I'm not experienced with JS, so if
there is a way to do this please let me know the JS syntax.

Apr 13 '06 #2
Thanks. This does work... sort of. The value is being wrtten to the label
onclick, but the data is not surviving the trip to the server for some
reason. If I unhide the label, I can see it flash the date and then
disappear when the page is served by the server. Any server side code sees
the label as empty.

It would seem intuitive that if the label held data before being posted, it
should be seen by the server. There is obviously something fundatmental that
I'm missing here.

"Michael Kolias" <mi***@alspaconsulting.com> wrote in message
news:aJ******************************@speakeasy.ne t...
Server Side Code, In the Page_Load sub add this:
yourSubmitButton.Attributes.Add("onclick", "registerUploadTime();")

Client Side Code, Inside the head tag add this:
<script type="text/javascript">
function registerUploadTime()
{
document.getElementById('lblUploadStartTime').inne rText = Date();
}
</script>

"Chip" <ch**@intradata.com> wrote in message
news:ep**************@TK2MSFTNGP03.phx.gbl...
I need to time a file upload using the 1.X HTML upload control. So I need
the time the upload started, which is problematic since no page processing
takes place until after the file is uploaded. Is there a way to write to
the form (lblUploadStartTime) before the upload begins using Javascript --
using the OnClick of the Submit button? I'm not experienced with JS, so if
there is a way to do this please let me know the JS syntax.


Apr 14 '06 #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: syd | last post by:
I have an intranet app that i would like to just capture the Path contained in the file field html control. The app will reside on an intranet and we all will have access to this path - it seems a...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
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...
3
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: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
2
by: =?Utf-8?B?SHVzYW0=?= | last post by:
hi everybody: I have the follwing code that I used it to upload data to my web site: the code: Sub SaveFile(ByVal file As HttpPostedFile) Dim savePath As String =...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.