Re: [PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-23 Thread tedd

At 1:46 PM -0600 4/22/09, scubak1w1 wrote:

I am thinking that is where I am at... as you said, the user just needs to
know that there computer is busy, hang on a second already!  

I like those icons - if I may be so bold though, and excuse the broadness of
the question, are you / can you use some Javascript to display this as the
file uploads? I am already using AJAX on the page/form so I guess I could
add an icon to the page before I run the PHO to upload the file, yes?

BUT I do appreciate all of the other suggestions, very muich - some weekend
reading & experimenting I am thinking...   :-)


There's really no need for javascript.

Just direct the user to a page that provides the upload and have that 
page show the "loading" gif.


Look, make it easy on yourself. I could have saved a week, or more, 
of my life by taking that approach when I first thought of the 
question "What do I show the user while the file is uploading?" But 
no, I went the complete route of setting up communication between the 
client and server to track the upload -- that's not easy because php 
has no client-side functionality and javascript is prohibited from 
accessing the file information you need on the users machine 
(security concerns). So, it can't be done easily.


But in the end, users are like clients, there's no need to explain in 
detail what you are doing -- just make whatever it is work AND look 
good and everything will be okey-dokey by them.


To prove my point, the next time you see a good looking web site, try 
running it through the W3C validator. (http://validator.w3.org). If 
clients were concerned about things being done right, there would be 
a lot more web sites validating.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-22 Thread Manuel Lemos
Hello,

on 04/22/2009 04:46 PM scubak1w1 said the following:
> I am thinking that is where I am at... as you said, the user just needs to 
> know that there computer is busy, hang on a second already!  
> 
> I like those icons - if I may be so bold though, and excuse the broadness of 
> the question, are you / can you use some Javascript to display this as the 
> file uploads? I am already using AJAX on the page/form so I guess I could 
> add an icon to the page before I run the PHO to upload the file, yes?

You may want to take a look at this forms class that comes with an
upload progress plug-in.

http://www.phpclasses.org/formsgeneration


That plug-in sends an AJAX/COMET request when the form upload starts and
the files are long enough, it shows a progress bar with some statistics
like upload speed, transferred data, remaining time, etc.. Here you can
see it working live:

http://www.meta-language.net/forms-examples.html?example=test_upload_progress

You may also want to watch this tutorial video:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-upload-meter.html


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-22 Thread scubak1w1

""scubak1w1""  wrote in message 
news:44.c6.33545.6747f...@pb1.pair.com...
>
> "tedd"  wrote in message 
> news:p0624080ac614d6bf9...@[192.168.1.101]...
>> At 9:28 PM -0600 4/21/09, scubak1w1 wrote:
>>>Hello,
>>>
>>>Can someone pass on some suggestions of some good, simple file upload 'in
>>>progress' code?
>>
>>
>> After all is said, you can pick anything you want from here:
>>
>> http://webbytedd.com/bb/wait/
>>
>> This is as simple as it gets for there is no simple solution.
>>

[snip]

How dumb am I?

As you  stated, 'we' just wanted the user to know "the computer is up to 
something"...

So I just changed the cursor icon with some JS:

 document.body.style.cursor = 'wait';

and then when the file had uploaded

 document.body.style.cursor = 'auto';

 



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



Re: [PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-22 Thread scubak1w1

"tedd"  wrote in message 
news:p0624080ac614d6bf9...@[192.168.1.101]...
> At 9:28 PM -0600 4/21/09, scubak1w1 wrote:
>>Hello,
>>
>>Can someone pass on some suggestions of some good, simple file upload 'in
>>progress' code?
>
>
> After all is said, you can pick anything you want from here:
>
> http://webbytedd.com/bb/wait/
>
> This is as simple as it gets for there is no simple solution.
>
> If you want a real-time upload progress bar, then you may find it too much 
> effort for the small return it provides. Yoyu might want to take the easy 
> way out like I did.
>
> Besides, what does a user expect anyway? They just want to know that 
> something is happening and an animated gif works as well as anything else. 
> Is it really important (or do they care) for them to know when 50% is 
> uploaded?


Thanks Tedd,

I am thinking that is where I am at... as you said, the user just needs to 
know that there computer is busy, hang on a second already!  

I like those icons - if I may be so bold though, and excuse the broadness of 
the question, are you / can you use some Javascript to display this as the 
file uploads? I am already using AJAX on the page/form so I guess I could 
add an icon to the page before I run the PHO to upload the file, yes?

BUT I do appreciate all of the other suggestions, very muich - some weekend 
reading & experimenting I am thinking...   :-) 



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



Re: [PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-22 Thread tedd

At 9:28 PM -0600 4/21/09, scubak1w1 wrote:

Hello,

Can someone pass on some suggestions of some good, simple file upload 'in
progress' code?



After all is said, you can pick anything you want from here:

http://webbytedd.com/bb/wait/

This is as simple as it gets for there is no simple solution.

If you want a real-time upload progress bar, then you may find it too 
much effort for the small return it provides. Yoyu might want to take 
the easy way out like I did.


Besides, what does a user expect anyway? They just want to know that 
something is happening and an animated gif works as well as anything 
else. Is it really important (or do they care) for them to know when 
50% is uploaded?


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] Suggestions of some good, simple file upload 'in progress' code?

2009-04-21 Thread scubak1w1
Hello,

Can someone pass on some suggestions of some good, simple file upload 'in 
progress' code?

Maybe as simple as changing the cursor icon for the duration?

I have am HTML form that gathers some data and allows for a file upload of 
up to 80Mb (on a secure site, and limited to *.zip files) - all works well, 
pretty simple stuff... 

...

...
{uses array_key_exists, various checks to make sure a file is selected, 
has a ZIP extension, etc)
...
//store the $_FILES 'final' file name in a variable for later use...
  $_SESSION['final_uploaded_zip_file_name'] = 
$_FILES['new_module_zip_file']['name'];

  //DRAFT @ 04/06/09 --> change cursor icon whilst the file is 
uploading and/or use a progress bar

  //save the temp file that $_FILES creates to it's "upload" home, 
ready for the site manager to process
  
move_uploaded_file($_FILES['new_module_zip_file']['tmp_name'],$default_upload_directory.$_SESSION['final_uploaded_zip_file_name']);
...

The user can look in the the lower left, say, to see they upload progress 
(sic) that is part of the browser.

BUT it would be nice to have some page specific visual prompt for the user, 
depending on their connection 80Mbs might take a while!   As 
mentioned, even something as simple as changing the cursor to an hourglass 
for the duration might help...

I have found a few examples of upload meters, but was looking for something 
simpler - and, to be frank, something more within the grasp of my current 
PHP coding abilities (or lack thereof!)

*Thanks in advance*:
GREG...




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