Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-30-2011, 08:06 AM
KidCactus is offline KidCactus
Registered User

Join Date: May 2011
Posts: 1

phUploader progress bar?

Is it possible to implement a progress bar for the upload in some easy way?
Reply With Quote
  #2  
Old 10-27-2011, 09:31 AM
djkfunk is offline djkfunk
Registered User

Join Date: Oct 2011
Posts: 7

I'm very interested in this as well. I'm trying to piece one together and will post it if I'm successful.
Reply With Quote
  #3  
Old 10-27-2011, 07:36 PM
djkfunk is offline djkfunk
Registered User

Join Date: Oct 2011
Posts: 7

Okay, it took a lot of time/trial/error but I found a solution for the progress bar. This is BY FAR the easiest one to implement (I tried many others). It's a combination of Javascript and AJAX, there's very little code, and the best part is it doesn't add any additional pages - which I love because I'm a minimalist.

1. Go to http://www.ajaxload.info/ and generate an image for your progress bar. This site has great choices and allows customization if you want to match your site's colors.

2. Insert this code just before the end of the </head> tag in phUploader.php. If the </head> tag is missing like it was in mine, you can insert it around line 273.

HTML Code:
<script language="javascript" type="text/javascript">
	function loadSubmit() {
	var ProgressImage = document.getElementById('progress_image');
	document.getElementById("progress").style.visibility = "visible";
	setTimeout(function(){ProgressImage.src = ProgressImage.src},100);
	return true;
	}
</script>
3. Insert this code wherever you want the progress bar to show. I put mine below the submit and reset buttons, around line 420 (haha - seriously). (NOTE - If you remove the <p> tag, the progress bar might not stay hidden until you submit, like it's supposed to). Also, you'll notice a reference to the images folder here, so you'll either need to create the directory "images" or change the code to match wherever you put the image.

[HTML]
<p style="visibility:hidden;" id="progress"/><img id="progress_image" style="padding-left:5px;padding-top:5px;" src="images/ajax-loader.gif" alt=""> Uploading in progress
Reply With Quote
  #4  
Old 10-27-2011, 07:42 PM
djkfunk is offline djkfunk
Registered User

Join Date: Oct 2011
Posts: 7

hmm...part of that got cut off. Here's the code for #3:

[HTML]<p style="visibility:hidden;" id="progress"><img id="progress_image" style="padding-left:5px;padding-top:5px;" src="images/ajax-loader.gif" alt=""> Uploading in progress
Reply With Quote
  #5  
Old 10-27-2011, 07:44 PM
djkfunk is offline djkfunk
Registered User

Join Date: Oct 2011
Posts: 7

uhh...i don't know what's happening...it keeps cutting me off...PM me if you need the progress bar.
Reply With Quote
  #6  
Old 12-14-2011, 09:46 PM
alja1 is offline alja1
Registered User

Join Date: Sep 2011
Posts: 1

I'd like the code that was cut off

My friend, you said that the code kept getting cut off. Can you email me the complete code for the progress bar? I can't PM because I don't have 5 posts. Thanks so much in advance.
Reply With Quote
  #7  
Old 05-23-2012, 07:00 PM
djkfunk is offline djkfunk
Registered User

Join Date: Oct 2011
Posts: 7

Sure, this is the code:

HTML Code:
<span style="visibility:hidden;" id="progress" align="center" /><img id="progress_image" style="padding-left:5px;padding-top:5px;" src="images/ajax-loader.gif" alt=""><br />
            <font color="#FFFFFF" size="-1">Upload in progress...</font>
You can change the "IMG ID" if you want, and you may need to change the "SRC" based on where your image is located and what it's called.

Good luck!
Reply With Quote
  #8  
Old 08-04-2012, 11:19 AM
blade x is offline blade x
Registered User

Join Date: Aug 2012
Posts: 3

I ad the below code but it fails to show and im also using the same file and image location as you

PHP Code:
<script language="javascript" type="text/javascript">
    function 
loadSubmit() {
    var 
ProgressImage document.getElementById('progress_image');
    
document.getElementById("progress").style.visibility "visible";
    
setTimeout(function(){ProgressImage.src ProgressImage.src},100);
    return 
true;
    }
</
script>
<
p><span style="visibility:hidden;" id="progress" align="center" /><img id="progress_image" style="padding-left:5px;padding-top:5px;" src="images/ajax-loader.gif" alt=""><br />
            <
font color="#FFFFFF" size="-1">Upload in progress...</font></p
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
work in progress sig Skin Sigs and Graphics 4 03-10-2009 06:02 PM
C3D Progress Terry Sigs and Graphics 16 07-10-2005 04:20 PM
in progress NaughtyPerry Web design and Programming 14 04-15-2005 02:31 PM
Work in progress.... tzer Sigs and Graphics 26 12-06-2004 06:05 PM


All times are GMT -5. The time now is 11:35 PM.




Powered by vBulletin®