FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to get info about uploaded files while upload process





shamil
How can i get how much size of file have been uploade while upload process continues.
Does anybody kows?
( php script )
Ratman2050
shamil wrote:
How can i get how much size of file have been uploade while upload process continues.
Does anybody kows?
( php script )



Do you really need a script for that? It usually tells you in KB or MB how large your file is, and how many files are needed to upload.
rohan2kool
Well, it's a pretty dirty trick. What you do is use AJAX to do that. Using iframe's you upload the file to the server and at the same time, constantly conact the server using XMLHttpRequest to a file which reports the size of the file being uploaded. This trick is just not recommended for the obvious pitfalls in it's way. But, you also need to know where to look for the file. Like, while uploading the file thru a php script which uploads it to a location like /myhome/files/thefile.ext, you won't find the file at that place till the upload is complete. It'll be there in the temp_uploads folder. check ur php.in to know the folder on ur server system. I also think, there is a php constant to know that, not pretty sure for that.
shamil
Ratman2050 wrote:
shamil wrote:
How can i get how much size of file have been uploade while upload process continues.
Does anybody kows?
( php script )



Do you really need a script for that? It usually tells you in KB or MB how large your file is, and how many files are needed to upload.


It will be script or just way of how to do that like rohan2kool replied. I meant i must write code in php by saying php script. (Not in anyother language). And it will be multifile upload. Now i am going to use ajax to do that as rohan2kool told. But not sure about result. Thank you both.
shamil
rohan2kool wrote:
Well, it's a pretty dirty trick. What you do is use AJAX to do that. Using iframe's you upload the file to the server and at the same time, constantly conact the server using XMLHttpRequest to a file which reports the size of the file being uploaded. This trick is just not recommended for the obvious pitfalls in it's way. But, you also need to know where to look for the file. Like, while uploading the file thru a php script which uploads it to a location like /myhome/files/thefile.ext, you won't find the file at that place till the upload is complete. It'll be there in the temp_uploads folder. check ur php.in to know the folder on ur server system. I also think, there is a php constant to know that, not pretty sure for that.


I tried to do as you told. But when i attempted to get the size of temp_file while upload process it couldn't find the file.
I insert the temp name of file to database table. Then with another file which will be called by ajax i select name and try to get the size.
Problem is script suspends until $_FILE array is complete so it writes temp_name to table after upload. So the temp_name would have been already deleted by the time second file tries to access it. I must know temp_name in the start of upload. But how to find temp_name? Without it i can not talk about temp filesize.
Related topics
Is this hosting allowed to upload music?
For Those Of You Who Like To Upload Music To The Net
large file
Directory copying is not currently supported (*SOLVED*).
why i can't upload through "File Manager" ?
PhpNuke Installation Tutorial
phpBB - Installation Tutorial
Windows XP and FTP Two problems one answer?
Uploading Joomla
Uploading and resizing an image
Best filemanager?
I cant delete files..
Uploading music script security risks?
Mastering the track, online
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.