Closed Thread Icon

Topic awaiting preservation: File Upload (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12893" title="Pages that link to Topic awaiting preservation: File Upload (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: File Upload <span class="small">(Page 1 of 1)</span>\

 
Lauw_HG
Obsessive-Compulsive (I) Inmate

From: Jakarta
Insane since: Sep 2003

posted posted 09-12-2003 14:32

Hi I want to ask something about uploading file in PHP, sorry if this question has already asked before
i want to upload a file and i want to calculate the time when the upload start until the uploaded file arrives on my server but i don't know how to that. can you help me with this problem..thanks n sorry if my english is not good

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 09-12-2003 15:19

Lauw_HG: Welcome

We have addressed some of these issues before and I drew the threads together here:

:FAQ: How do I upload files using PHP?

but I don't think the question has come up before. It might be that this kind of thing is more useful to you:

:FAQ: How do I time the execution of my scripts?

and as you are new here I'd also recommend you drop by:

:FAQ: The Reception Room

___________________
Emps

FAQs: Emperor

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 09-12-2003 18:16

Hi Lauw_HG

I don't think you'll be able to do this with PHP alone. I was thinking you could use javascript to generate a timestamp when the submit button is clicked and send that along to your script and then compare that to the time that your php script that catches the upload. The difference between the 2 should be the actual time it took to upload the file.

Hope this helps

-Butcher-

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 09-12-2003 20:33

neglecting of course the time difference between the client and the server, which usually is 'huge', for some value of huge

Bmud
Bipolar (III) Inmate

From: Raleigh, NC
Insane since: Mar 2001

posted posted 09-12-2003 23:45

*bookmark*

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 09-13-2003 01:23

Thanks for throwing that in TP, I didn't even consider that when I wrote the post.

Is there anyway to figure the difference between the client time and the servers?

-Butcher-

Lauw_HG
Obsessive-Compulsive (I) Inmate

From: Jakarta
Insane since: Sep 2003

posted posted 09-13-2003 04:30

emperor : the links are not functioning but thanks to remind me

butcher : thanks but i've already tried this and it's not worked. every time the file uploads from my client i've stored a log of it in my database, field startupload to store the time when the client start uploading and endupload when it finished. n something funny happen for example : 2003-09-13 21:07:54 is the value startupload n 2003-09-13 09:18:13 is the value of endupload. it looks like my clients are too lazy to check the time in their computer. n it's occure many times, is there any solutions for this ?



Alevice
Paranoid (IV) Inmate

From: Mexico
Insane since: Dec 2002

posted posted 09-13-2003 04:54

measure the time of the execution? =

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 09-13-2003 09:22

what you could do is get the time the user downloaded the uploading html page... that's on your server clock, but it's gonna be varying quite a bit. or maybe a hidden frame that get's posted t othe server as well, which then can be used to measure the time...

as for the differing clocks problem: Not in a way that is more exact than about 10 seconds, with the current web technology, I'd say.

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 09-13-2003 11:54

Well...the page which the form is loading to won't load until the file has finihed uploading. Why not send one timestamp to the server when the user clicks the uplaod button, then send a second one when it loads the page the form is linked to and simply do a time comparison between them to see the time difference?

Lauw_HG
Obsessive-Compulsive (I) Inmate

From: Jakarta
Insane since: Sep 2003

posted posted 09-16-2003 03:24

Skaarj : can you tell me how to send a timestamp to the server ? is it like sending a date ? i've used it before, when a user click upload button and it will send the date at the client to the server. and can you explain it to me about the last part of your post about the time difference? i don't understand too much...

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 09-16-2003 16:12

Well...that's all javascript stuff..things of which I know almost nothing about...one of the other javascript guys here'd have to tell you. But basically when the user clicks the 'upload' button, a unix timestamp would be generated (which meansures the current time in seconds since the UNIX epoch). Then, you'd add something into (I think) the head area of your target page in the form (you know...the page you put into 'action=') telling it onPageLoad send another time stamp, then you'd grab both of those with a script, subtract the first one form the second one...convert it to something readable to the average person and output it.

But as I said...this is javascript stuff...don't know much about it so i can't tell you exactly how to do it.

« BackwardsOnwards »

Show Forum Drop Down Menu