TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-01-2009, 12:44 PM   #1 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
Thanks: 1
dhaval is on a distinguished road
Default Show Process While Image Upload

Hello Friends,

I've coded for multiple Upload Image like gmail but now want to show to client that image is uploading and there should be a note for Wait Can anyone tell me that how to show that process image till image is uploading.

Thanks in advance.
dhaval is offline  
Reply With Quote
Old 09-01-2009, 01:24 PM   #2 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Once again, dhaval, you have made a completely incoherent post that shows absolutely no work on your part.

Are you trying to have an upload bar showing the progress of each individual file? Or do you just want to have a moving image to reassure the client that his upload is taking place?
__________________

Village Idiot is offline  
Reply With Quote
Old 09-01-2009, 01:26 PM   #3 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

There are two ways to display the current progress for a image upload.

APC Cache has a method of doing here is a extensive guide from IBM on exactly how do to so
http://www.ibm.com/developerworks/li...525/index.html

You may also use the PECL Package http://pecl.php.net/package/uploadprogress which works in the same way APC will
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Old 09-01-2009, 01:45 PM   #4 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
Thanks: 1
dhaval is on a distinguished road
Default

I want to show to client that Image is Uploading means in process
while we upload any image it shows one note "Please Wait Your Image is Uploading" or process circle.
dhaval is offline  
Reply With Quote
Old 09-01-2009, 05:17 PM   #5 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

You should try to do the work your self, at least try to use google mate.

google -> Tracking file upload progress + php or something..
not that hard.


-CF

Last edited by codefreek : 09-01-2009 at 05:38 PM.
codefreek is offline  
Reply With Quote
Old 09-02-2009, 06:04 AM   #6 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
Thanks: 1
dhaval is on a distinguished road
Default code

Hello Friends,

Thanks for your replies
I've solved the problem
need to run java script's function
but there is another problem in uploaded image
in image folder it shows "Array File" and that file show only first image very strange
and below is the code even also for Multiple Upload

<html>
<body>
<head>
<style>
.box{
margin-right:140
}
</style>
<script>
function getBox(){
fileBox=document.createElement('input');
fileBox.setAttribute('type','file');
fileBox.setAttribute('name','txtFile[]');
fileBox.className='box';
document.forms[0].appendChild(fileBox);
tr=document.createElement('<tr>');
document.forms[0].appendChild(tr);
}
function getMessage(){
document.getElementById('message').innerHTML="<img src=loading.gif>";
}
</script>

</head>
<center>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>" enctype="multipart/form-data">
<input type="file" name="txtFile[]" />
<input type="submit" value="Upload File" name="upload" onClick="getMessage()" />
<a href="#" onClick="getBox()">More</a>
<div id="message"></div>
</form>
</center>
</body>
</html>
<?php
if(isset($_POST['upload'])){
$totalFiles=count($_FILES['txtFile']['name']);
$fileName=$_FILES['txtFile']['name'];
$filePath='upload_file/'.$fileName;
for($intCounter=0;$intCounter<$totalFiles;$intCoun ter++){
if(copy($_FILES['txtFile']['tmp_name'][$intCounter],$filePath)){
echo "Image is upload Successfully";
}else{
echo "still remain something";
}
}
}
?>
dhaval is offline  
Reply With Quote
Old 09-02-2009, 07:21 AM   #7 (permalink)
The Contributor
 
Join Date: Mar 2009
Posts: 49
Thanks: 0
TheOnly92 is on a distinguished road
Default

When you upload multiple files, $_FILES['txtFile']['name'] is an array, you will have to do $_FILES['txtFile']['name'][0] to retrieve 1 of the files' name.
TheOnly92 is offline  
Reply With Quote
Old 09-02-2009, 11:24 AM   #8 (permalink)
The Contributor
 
dhaval's Avatar
 
Join Date: Jul 2009
Posts: 37
Thanks: 1
dhaval is on a distinguished road
Default

I've already done it but the diff. is that i've stored in variable called $intCounter then pass the loop so that every file box can retrieve.
dhaval is offline  
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a gallery class Tanax Advanced PHP Programming 25 02-19-2013 04:25 AM
Image Reflections in PHP Rendair Advanced PHP Programming 17 11-30-2011 08:41 AM
why does this border show when i click on a image button sarmenhb XHTML, HTML, CSS 2 12-02-2008 07:49 PM
Preview: Upcoming Image Upload Script + Member System Gareth Show Off 2 07-10-2008 06:56 PM
Please Help, How to show upload progress information ganda Advanced PHP Programming 5 07-05-2008 07:26 PM


All times are GMT. The time now is 05:52 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design