Re: [PHP] how to know upload progress status

2002-07-12 Thread Alberto Serra

ðÒÉ×ÅÔ!

John Holmes wrote:
 Not possible with HTTP, as far as I know. The file is simply sent,
 there's no communication back and forth.
 
 ---John Holmes...

That's from within a single script. But it becvomes possible if you have 
a page like this

+---+
! +---+ !
!  main   ! c ! !
! +---+ !
+---+

where main is executing the upload and c runs by metarefresh a second 
script that watches how the temp file is growing on the server. So the 
guy is right in his second try to it.

Sadly the $_FILES variables will be available only after the upload is 
completed, so in order to have that up and running he will also need to:

1) create a uniquely identified dir to which only that user upload will 
be sent (that's done when dynamically creating the upload form)
2) pass the dir name along to the monitoring script.
3) clear the directory on upload successful completion
4) periodically clear the amount of temporary dirs that have remained on 
the server as a result for process failures.

If all you do is managing file uploads all the time you might want to 
limit your number of concurrent uploads by creating a pool of TMP dirs 
that you will share among users. When they are all got your users have 
to wait, but you don't freak out because of an exponential growth of 
abandoned dirs.

It *is* complicated. But if you really have to do it... I wish you not 
to need it, anyway.

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] how to know upload progress status

2002-07-11 Thread S.

Hello,
I'm beginning to use PHP, maybe my question is very simple...
Anyway, I want permit users to upload files using a form, and I would show 
them the upload progress status...
I don't know how to extract informations about upload progress status and how 
to show informations to users. For example I want the users can see 30% of 
upload completed, or the MByte just uploaded.


I had some difficulties to write to the list, so I send the mail (with some 
modifies in the address) several times;
I apologyze if many mails are sended to the list.



Thanks for help...!
S.





In th file fileupload.php I call a function named uploadfile as shown in 
the follow code:
 





uploadfile($g_dir_corrente);





if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
{
$nomefile=$HTTP_POST_FILES['userfile']['name'];





if(($nomefile!=.htaccess)($nomefile!=.ftpaccess)($nomefile!=.quota))
{  
copy($HTTP_POST_FILES['userfile']['tmp_name'],$g_dir_corrente/$nomefile);
messaggio(12); // show a message to users
echo br;
}
else
{
messaggio(13); // show a message to users
}
}





**





function uploadfile($g_dir_corrente)
{
$Upload_file=messaggioX(11); // show a message to users 
echo

form enctype=\multipart/form-data\ action=\fileupload.php\ 
method=\post\
input type=\hidden\ name=\MAX_FILE_SIZE\ value=\10\
$Upload_file input name=\userfile\ type=\file\
input type=\submit\ value=\Upload\
/form
;
}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] how to know upload progress status

2002-07-11 Thread John Holmes

Not possible with HTTP, as far as I know. The file is simply sent,
there's no communication back and forth.

---John Holmes...

 -Original Message-
 From: S. [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 11, 2002 2:45 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] how to know upload progress status
 
 Hello,
 I'm beginning to use PHP, maybe my question is very simple...
 Anyway, I want permit users to upload files using a form, and I would
show
 them the upload progress status...
 I don't know how to extract informations about upload progress status
and
 how
 to show informations to users. For example I want the users can see
30% of
 upload completed, or the MByte just uploaded.
 
 
 I had some difficulties to write to the list, so I send the mail (with
 some
 modifies in the address) several times;
 I apologyze if many mails are sended to the list.
 
 
 
 Thanks for help...!
 S.
 
 
 
 
 
 In th file fileupload.php I call a function named uploadfile as
shown
 in
 the follow code:
 
 
 
 
 
 
 uploadfile($g_dir_corrente);
 
 
 
 
 
 if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name']))
 {
 $nomefile=$HTTP_POST_FILES['userfile']['name'];
 
 
 
 
 

if(($nomefile!=.htaccess)($nomefile!=.ftpaccess)($nomefile!=.qu
ot
 a))
 {

copy($HTTP_POST_FILES['userfile']['tmp_name'],$g_dir_corrente/$nomefile
)
 ;
 messaggio(12); // show a message to users
 echo br;
 }
 else
 {
 messaggio(13); // show a message to users
 }
 }
 
 
 
 
 
 **
 
 
 
 
 
 function uploadfile($g_dir_corrente)
 {
 $Upload_file=messaggioX(11); // show a message to users
 echo
 
 form enctype=\multipart/form-data\ action=\fileupload.php\
 method=\post\
 input type=\hidden\ name=\MAX_FILE_SIZE\
value=\10\
 $Upload_file input name=\userfile\ type=\file\
 input type=\submit\ value=\Upload\
 /form
 ;
 }
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php