HTML, form input onclick does not work
I've been googling for the last 4 days to figure this problem out. It seems so simple yet nothing I've tried has worked. Let me explain:
I started running apache so that my friend from across the water can upload his projects to me for evaluation. Occasionally these uploads are quite large (200-700MB). My upload page works, everything is good. Not quite... When the submit button is pressed, nothing seems to happen. The page just sits there while browser chews on the 200MB file for some time, then the upload begins. After the file is fully sent, finally the cgi script that handles it is called, and everything is done. Fine. The problem is twofold: 1. Not only would I like to time the upload so I know what kind of throughput I'm getting, but I would also like the user to get some immediate feedback when pressing the submit button. The original idea was just to put a timestamp in the apache access_log and blank the page the instant the user clicks the submit button. 2. The onclick cgi script never gets executed. As a matter of fact, I cannot get <INPUT onclick= ... > to work at all. Here's the upload page: Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> and here's the test.sh: Code:
#!/bin/bash One of the issues, if you load the html page, is that even if you click the test link that calls this script straight up, it just loads from cache, and the script doesn't actually execute unless you hit refresh. The idea is that it gets called when the user presses the submit button, not 10 minutes later after the upload is done. It does work if I put the script in the action field, but then not until upload is finished, which is exactly what I'm trying to get around. Any ideas? |
It doesn't work like that.
I have not fully digested your code, but first... Code:
<FORM action="/cgi-bin/upload.pl" method="post" enctype= Next, when you submit to the upload target, it can do nothing until it receives your full request, which includes the uploaded data... hence it cannot respond until AFTER the file is fully uploaded. What you can do is alert the user that the upload is going to take a few minutes, maybe something like this (untested)... Code:
<FORM action="/cgi-bin/upload.pl" method="post" enctype= |
There is a separated protocol for this purpose: FTP. Use 'hash' command to get visual feedback.
|
Thanks for the replies, and thank you very much for clarifying those issues, astrogeek. That is basically what I was beginning to suspect. I like your idea about the alert box, I'll try that.
As for FTP, I agree. That's where I started, and that's what I prefer: simple, elegant, and it works. Everything in 1 logfile, easy to configure. But, unfortunately, my friend is not very well versed in the ancient arts. FTP seems to scare him or something, I have no idea why. He's one of those artsy-fartsy types :) So I fired up Apache to be more user-friendly. *shrug* |
All times are GMT -5. The time now is 12:10 AM. |