PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The latest version of Simplicity oF Upload is 1.3.2.

Author Topic: Progress Bar  (Read 6609 times)

0 Members and 1 Guest are viewing this topic.

Paul York

  • Guest
Progress Bar
« on: April 20, 2010, 02:19:11 PM »

Is there any way to show a progress bar during uploads. Would be real helpful
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Progress Bar
« Reply #1 on: May 14, 2010, 01:20:20 PM »

Not possible without hacking PHP engine itself.
Logged

We don't need a reason to help people

kwone67

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Progress Bar
« Reply #2 on: June 12, 2010, 02:45:40 AM »

Hi Saleh,

First, I just wanted to say thanks for the excellent script and offering your help! Your good work is appreciated and I just wanted to say Thank You:)

Second, rather than hacking the php engine could a simple animated gif image work?  I mean after a person selects the "upload" button a simple animated gift is displayed (that has nothing to do with real time file upload status) and stops or redirects to show the uploaded file when the upload is complete?

People send me 1-2GB files and they think that when they see a static looking page for an hour while there file uploads  that something must be wrong and tend to refresh or navigate away!

Thanks again

Kevin



 

Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Progress Bar
« Reply #3 on: June 24, 2010, 09:46:03 AM »

That would be fairly easy :)
Find in functions.php:
Code: [Select]
   <tr>
      <td align="center">
      <span style="font-size: 7pt; font-family: tahoma, verdana;">'.$txt['powered'].': <a href="http://www.phpsimplicity.com" target="_blank">&copy; '.NAME.'</a></span><br />
        <input type="submit" value="  '.$txt['submit'].'  " name="SFUsubmit" '.$disabled.'/></td>
   </tr>

Replace with:
Code: [Select]
   <tr>
      <td align="center">
      <span style="font-size: 7pt; font-family: tahoma, verdana;">'.$txt['powered'].': <a href="http://www.phpsimplicity.com" target="_blank">&copy; '.NAME.'</a></span><br />
        <div id="progressBar" style="display: none;"><img src="PATH/TO/PROGRESS_BAR.gif" /><br />Please wait ...<br /></div>
        <input type="submit" value="  '.$txt['submit'].'  " name="SFUsubmit" onclick=\'javascript:document.getElementById("progressBar").style.display="block"\' '.$disabled.'/></td>
   </tr>

This should work. Simply change "PATH/TO/PROGRESS_BAR.gif" to the actual progress bar image and once the submit button is clicked, it will be displayed.

Try it, and let me know.
Logged

We don't need a reason to help people

kwone67

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Progress Bar
« Reply #4 on: June 24, 2010, 01:43:05 PM »

Well it looks like it want's to work but it does not.  I have attached a screen shot to show you what I am looking at, it seems that it can't display the image correctly and just shows a place holder.  I also tried this with a jpg, gif and png but same result, I also checked the path to the image and it is correct.

Kevin
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Progress Bar
« Reply #5 on: June 29, 2010, 12:46:29 PM »

Could you post the code?
Because that is definitely a problem with the image not the code. my code simply shows/hide the area so it's not Javascript's fault.
Logged

We don't need a reason to help people

kwone67

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Progress Bar
« Reply #6 on: June 29, 2010, 01:28:34 PM »

Okay this is what I have.

Kevin

Code: [Select]
  </tr>
   <tr>
      <td align="center">
      <span style="font-size: 7pt; font-family: tahoma, verdana;">'.$txt['powered'].': <a href="http://www.phpsimplicity.com" target="_blank">&copy; '.NAME.'</a></span><br />
        <div id="progressBar" style="display: none;"><img src="/usr/local/4admin/apache/vhosts/metrotechglobal.com/addon/lowcost-exhibits.com/progressBar.gif" /><br />Please wait ...<br /></div>
        <input type="submit" value="  '.$txt['submit'].'  " name="SFUsubmit" onclick=\'javascript:document.getElementById("progressBar").style.display="block"\' '.$disabled.'/></td>
   </tr>
    </form>
</table>';

   echo $form;
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Progress Bar
« Reply #7 on: June 30, 2010, 02:59:00 PM »

I see. Image src should be relative to the base directory of the http server..
meaning, if your website URL is metrotechglobal.com and you stored the image in addon/images you simply put "addon/images/progressBar.gif" in src:
<img src="addon/lowcost-exhibits.com/progressBar.gif" />
Logged

We don't need a reason to help people

kwone67

  • Newbie
  • *
  • Offline Offline
  • Posts: 5
    • View Profile
Re: Progress Bar
« Reply #8 on: July 06, 2010, 09:37:29 PM »

Okay I must be doing something wrong because I still can't get it to work.  I am not sure if it matters but I should mention that I want to use this script on my website that is an "addon domain" to the main hosting account website , www.metrotechglobal.com

According to my hosting company

"Addon Hosted - Hosted mode allows an Addon domain to be hosted as a full website with its own directory and file structure. Search engines see Hosted domains as having unique content, and therefore rank them as well as they would a fully hosted site. Once set up, files for Hosted Addon domains are uploaded to the addon/addondomain.com directory via FTP"

So the path to the "fully hosted" domain that I want to use the  script is addon/lowcost-exhibits.com

and I have tried the following paths to the progressBar.gif:

img src="addon/images/progressBar.gif"
img src="lowcost-exhibits.com/images/progressBar.gif"
img src="addon/lowcost-exhibits.com/images/progressBar.gif"

I even made a directory "images" for the main website httpdoc folder and tried this path as well:

img src="/images/progressBar.gif"
img src="metrotechglobal.com/images/progressBar.gif"


So I have both file structures in place on the server with the same progressBar.gif

metrotechglobal.com/addon/lowcost-exhibits.com/images/progressBar.gif"
metrotechglobal.com/images/progressBar.gif

Clearly I have no idea what I'm doing ??? your help is appreciated

Kevin




 
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Progress Bar
« Reply #9 on: July 15, 2010, 09:28:27 AM »

Code: [Select]
  </tr>
   <tr>
      <td align="center">
      <span style="font-size: 7pt; font-family: tahoma, verdana;">'.$txt['powered'].': <a href="http://www.phpsimplicity.com" target="_blank">&copy; '.NAME.'</a></span><br />
        <div id="progressBar" style="display: none;"><img src="../images/progressBar.gif" /><br />Please wait ...<br /></div>
        <input type="submit" value="  '.$txt['submit'].'  " name="SFUsubmit" onclick=\'javascript:document.getElementById("progressBar").style.display="block"\' '.$disabled.'/></td>
   </tr>
    </form>
</table>';

   echo $form;

This should solve everything :)
The problem was because you were not taking into account the relative paths of your structure.
Your upload script was in http://www.lowcost-exhibits.com/upload/upload.php
and you image was in http://www.lowcost-exhibits.com/images/progressBar.gif

You simply had to go up in the structure and then back to images folder.
Logged

We don't need a reason to help people
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
Are you a bot/spammer?: