473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

image upload with pagination

mac
Hi,

I'm looking for a script that will allow me to upload images to a
folder and shows pagination...
pls can any body help me?

i hav done with the uploading, but not able to do with the
pagination...here is the upload code..

<?php
define ("MAX_SIZE","100");
function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext; }

$errors=0;
if(isset($_POST['Submit'])) {
$image=$_FILES['image']['name'];
if ($image) {

$filename = stripslashes($_FILES['image']['name']);
$extension = getExtension($filename);
$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension !=
"png") && ($extension != "gif")) {
echo '<h1>Unknown extension!</h1>';
$errors=1; }
else {
$size=filesize($_FILES['image']['tmp_name']);
if ($size MAX_SIZE*1024){ echo '<h1>You have exceeded the size
limit!</h1>'; $errors=1;}
$image_name=time().'.'.$extension;
$newname="images/".$image_name;
$copied = copy($_FILES['image']['tmp_name'], $newname);if (!$copied)
{ echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;}}}}

if(isset($_POST['Submit']) && !$errors) { echo "<h1>Image Uploaded
Successfully! Try again!</h1>"; } ?>

<form name="newad" method="post" enctype="multipart/form-data"
action=""<table <tr><td><input type="file" name="image"></td></tr>
<tr><td><input name="Submit" type="submit" value="Upload image"></
td></tr</table> </form>
Sep 11 '08 #1
2 2106
On Thu, 11 Sep 2008 00:38:49 -0700, mac wrote:
I'm looking for a script that will allow me to upload images to a folder
and shows pagination...
pls can any body help me?

i hav done with the uploading, but not able to do with the
pagination...here is the upload code..
You should use move_uploaded_file() instead of copy().

What do you mean by pagination? What have you tried so far?
Sep 11 '08 #2
On 11 Sep, 08:38, mac <mhmun...@gmail.comwrote:
Hi,

I'm looking for a script that will allow me to upload images to a
folder and shows pagination...
pls can any body help me?
Where have you looked?

did you try putting
image upload with pagination
into Google and clicking "I'm Feeling Lucky"?
Sep 11 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DH | last post by:
I have a "file upload form" that works OK, but I have been unsuccessful in my attempt to also resize the uploaded .JPG (if it is too wide), over-writing the original .JPG, and then create and save...
0
by: Paul Hamlington | last post by:
Hello, I've been programming in ASP for a little while now and quite an advanced user, but I have come across an unusual problem in which I need assistance. I have built my own image upload,...
2
by: Faree | last post by:
Hi, I am a PHP Developer.can any one help me on image upload and display of that image.what i want is uploading an image to a directory ,displaying of that image as a thumbnail.when i...
3
by: Michael | last post by:
Hello, I want to write a componant that helps a user upload an image or file. I want something like you see on yahoo's image upload page. It has to work on mac and windows. Can anyone help me get...
1
pritipshah
by: pritipshah | last post by:
Hi All, I am using vtiger open source CRM and in that they are using FCKeditor for Image Upload (Resource browser window) but it is not upload or make new folder for image. Vtiger CRM...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
7
by: dragiton | last post by:
SA Upload SQL Database variable types (image upload and storage) I am having trouble with the SA Upload utility. The following code used to work correctly. However, I lost my database and had to...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
26
matheussousuke
by: matheussousuke | last post by:
May someone help me correct this script? there a few ' and " and ; in the wrong places: <?php include "./comm.inc"; connectdb(); $sql = "SELECT imgid,imgtype FROM...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.