Image Upload - ?!?

Pages: 1, 2
free web hosting

Latest Entry: (Post #11) by alex1985 on Jun 10 2008, 04:35 AM. (Line Breaks Removed)
That looks really good, I should try it. Thanks
Express your Opinion! Contribute Knowledge.

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Image Upload - ?!?

alex1985
I need the image upload script which automatically resized the image by specified size and store it in the specified folder.

Reply

oestergaard
google is your friend

Reply

alex1985
So, rude! The forums are created for the aim of helping and assisting people!

Reply

jlhaslip
Google results show 126,000 responses : http://www.google.ca/search?hl=en&as_q...amp;safe=images

Might want to also check out Hotscripts.com : http://www.hotscripts.com/PHP/Scripts_and_...tion/index.html

Try the third one on the Hotscripts list, for example.
http://www.hotscripts.com/Detailed/66112.html
Free, recent and the GD Library is installed on your trap17 account, so it should work fine here.

Reply

burhan
Here is great class for image resize http://www.phpclasses.org/browse/package/1450.html

You can also try www.picTarget.com, they are resizing image and storing in their server.

Reply

alex1985
Ok, I will try to create my own.

Reply

obiesan
You can use GD_LIB on php, to regenerate new Image with custom resolution. For the class img, u can find in phpclasses.org

Reply

alex1985
Thanks.

Reply

iGuest
I need the image upload script which automatically resized the image by specified size and store it in the specified folder.
Image Upload

Replying to alex1985

Try this
==============

<?php

// Connect to database

$errmsg = "";
If (! @mysql_connect("localhost","root","admin")) {
$errmsg = "Cannot connect to database";
}
@mysql_select_db("example");

// First run ONLY - need to create table by uncommenting this
// Or with silent @ we can let it fail every sunsequent time ;-)

$q = <<<CREATE
Create table pix (
pid int primary key not null auto_increment,title text,imgdata longblob)
CREATE;
@mysql_query($q);

// Insert any new image into database

If ($_REQUEST[completed] == 1) {
// Need to add - check for large upload. Otherwise the code
// will just duplicate old file ;-)
// ALSO - note that latest.Img must be public write and in a
// live appliaction should be in another (safe!) directory.
Move_uploaded_file($_FILES['imagefile']['tmp_name'],"latest.Img");
$instr = fopen("latest.Img","rb");
$image = addslashes(fread($instr,filesize("latest.Img")));
if (strlen($instr) < 149000) {mysql_query ("insert into pix (title, imgdata) values (\"".$_REQUEST[whatsit]."\", \"".$image."\")");
} else {
$errmsg = "Too large!";
}
}

// Find out about latest image

$gotten = @mysql_query("select * from pix order by pid desc limit 1");
If ($row = @mysql_fetch_assoc($gotten)) {
$title = htmlspecialchars($row[title]);
$bytes = $row[imgdata];
} else {
$errmsg = "There is no image in the database yet";
$title = "no database image available";
// Put up a picture of our training centre
$instr = fopen("../wellimg/ctco.Jpg","rb");
$bytes = fread($instr,filesize("../wellimg/ctco.Jpg"));
}

// If this is the image request, send out the image
If ($_REQUEST[gim] == 1) {
Header("Content-type: image/jpeg");
print $bytes;
exit ();
}

?>

<html><head>
<title>Upload an image to a database</title>
<body bgcolor=white><h2>Here's the latest picture</h2>

<font color=red>
<?=
$errmsg
?>
</font>


<img src=?gim=1 width=144><br>

<?=
$title
?>







<hr>
<h2>Please upload a new picture and title</h2>
<form enctype=multipart/form-data method=post>
<input type=hidden name=MAX_FILE_SIZE value=150000>
<input type=hidden name=completed value=1>
IMAGE: <input type=file name=imagefile><br>
NAME: <input name=whatsit><br>
PRESS: <input type=submit></form><br>
<hr>



</body>
</html>


-reply by Binu K James

 

 

 


Reply

alex1985
Thanks. I need to associate with some another file. So, when I create that file, I let you know, just I will create another topic.

Reply

Latest Entries

alex1985
That looks really good, I should try it. Thanks

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Similar Topics

Keywords : image, upload,

  1. Php Ftp Upload Form
    Adding User Directory to PHP Upload Form - Help (0)
  2. Get A Image Indentifier With Gd Library
    GD library question (7)
    Hey fellow coders, I'm having a problem. If you output a im indentifier in php with gd libary.
    With this method for example: CODE <?
    header("(anti-spam-(anti-spam-(anti-spam-content-type:)))
    image/png"); $imgWidth = 50; $imgHeight = 50;
    $image=imagecreate($imgWidth, $imgHeight); $colorBlack =
    imagecolorallocate($image, 0, 0, 0);  // first color you define with colorallocate is
    also the color of the background of your image imagepng ($image); image....
  3. Php And Flash Image Gallery
    Need some help in creating or editing an xml file while viewing some o (5)
    Hello there and thanks for the helping hand you are offering. PHP newbie here! /ph34r.gif"
    style="vertical-align:middle" emoid=":ph34r:" border="0" alt="ph34r.gif" /> So here is my problem:
    On my website I have a flash image gallery.The way the gallery works is by uploading pictures in a
    folder and editing? an xml file.(pics.xml) where it adds the following code when you upload a
    picture: CODE <pictures>     <image location="nameofpicture1.jpg"
    desc="" />     <image location="nameofpicture2.jpg" desc="" /&#....
  4. File Upload
    File upload (1)
    I need to add a facility on my customer's website so his clients can send him jobs, typically
    5mb - 50mb. I've looked around the web and researched this, and tried a few tests (failed), but
    my brain's beginning to hurt. Could someone please tell me the best way to go about this,
    please. The site is done in Flash, but I'm sure a link to an html page would be ok if necessary.....
  5. Batch Upload Script
    In need of batch upload script (1)
    I'm in the process of making a photo gallery script. I need ideas on how to make a batch upload
    script. I want the user to be able to upload files to a folder via FTP and then go to the admin
    section of the gallery and add the previously uploaded photos to the MySQL database. I guess what I
    need it to do is find all the files in a specific folder and see if they are already in the
    database, if they aren't in the database - add them. Any help would be appreciated. I figured
    trap17 would be a good place to get help with this /wink.gif" style="vertical-align:middle....
  6. Trap17 Board Status Dynamic Image
    (13)
    I was really board a few days ago and decided to make a trap17 board status image for my sig
    /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> That is the
    current beta. I'm still working on it so that it might display the most recent post or
    somthing, i'm not sure. After I finish it ill give out the source code but if you want one
    right now you can pm me and ill set one up to get the info on your account ^.^ So I was wondering
    how you members liked it? You'll probably think that its a waist of time, but alas as I sai....
  7. Flipping An Animated Gif Image W/ Gd Library
    Help (1)
    I need an animated gif image flipped using GD library in PHP. I wrote a script to flip still
    images, but it doesn't work on animated images. This is probably because I have the script
    moving 1 column of pixels at a time, and switching them around. How would I make multiple frames?
    Any help would be great! Thanks!....
  8. Detect Image Resolution Without Gd
    Also stop error if not found (1)
    Hi, I have come accross some starnge problem in PHP. I wanted to detect the image resolution in
    of a URL specified by the user. This is possible via getimagesize() function of PHP that is
    independent of GD library. But this function generates a E_WARNING Error if the image is not there.
    What shall i do to stop this warning ?? I dont want to show the Error in PHP style but my style of
    error reporting. Please help me.....
  9. Wappyftp V1.00
    upload to server via ftp from your mobile phone :-) (8)
    wappyFTP v1.00 by wappy --- site: http://cult.trap17.com mail: admin@cult.trap17.com --- -Welcome
    to wappyFTP, with this wap script your users can upload files directly to their server via FTP from
    a mobile phone! --- -Its extremley easy to install, open index.php and put the name of your site
    instead of YOURSITE.COM -Upload the folder wappyFTP_v1.00 to the root directory of your web server
    -Link to it like wappyFTP_v1.00/index.php -Its all done ENJOY --- YOU MAY DISTRIBUTE AND/OR EDIT
    THIS SCRIPT BUT DO NOT REMOVE THE AUTHORS NAME! --- ©2006-2007 wappyCULT /....
  10. Looking For Php Script : Image Thumbnail Like Imageshack.
    (2)
    Does anyone know a code like the one ImageShack uses, like this one. That would be just
    awesome, I hate doing it by hand, such a hassal. Until I can find a code similar to that, I think I
    will just use ImageShack.....
  11. Watermark Your Image With Simple Php Script
    found it on the net (35)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
    image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
    transparent gif image with the watermark - goes in the same directory as this script // ....
  12. Dynamic Image / Signature Generator
    a simple code to change text on an image (12)
    In search of dynamically changing quote, saying or all other types of text on an image I came across
    a code that I have modified to fit my initial usage. This procedure requires two files and short
    knowledge of PHP. If you are familiar with Trap17's sig rotation code you will understand this
    procedure very fast. Code 1: dynamic_sig.php (you can rename this to index.php and you'll see
    at the end why) Code 2: a simple text file named anything (I will call it name.txt ) Code 1
    CODE <?php header("Content-type: image/png"); �....
  13. Image Galleres
    (10)
    what is a really good image gallery i can hook up for my phpnuke site?? something easy to set up to.
    thanks....
  14. Php Photo And Image Gallery Script
    PHP Photo And Image Gallery Script (2)
    This script is great and the documentation is excellent!! I have used it on my site without
    really knowing much about PHP. Script ....
  15. Image Upload And File Size
    (2)
    Hi, I'm trying to upload rather large jpgs files (2560x1920 and ~ 2 megs in size) to my server
    via PHP. The problem I am having is that when I upload and attempt to resize by creating a new
    image, the new image is always black. Code I'm using is: PHP Code: CODE if(
    !empty($thefile_name) ) {                                                  
                                                 $query = "INSERT INTO coldwell_images
    (imagename) VALUES ('insertimage')";                    $result ....
  16. I Need A Php Editor
    I need that for image editing (1)
    I need a php editor whichc can be used for the image editing like FrontPage for HTML. Can any body
    give a link for that....
  17. Write Random Text To Image
    PHP script help! (5)
    I'm trying to create a script that writes text to an image. CODE
    header("Content-type: image/png"); $_phrases = array( "Test 1",
    "Test 2", "Test 3", "Test 4", "etc." ); $_rand_phrase =
    $_phrases[rand(0,count($_phrases)-1)]; $_image =
    imagecreatefrompng("gmail.png"); $_user_width =
    imaagettfbbox(9,0,"tahoma.ttf",$_rand_phrase); $_x_value =
    (200-($user_width[2] + 113)); ....
  18. Upload Pics With Php?
    (6)
    Can anyone help me out again? Thanks. I need a code that has a basic form that allows you to
    browse for an image file and when the submit button is clicked, that image gets uploaded to a folder
    in my site (e.g. images/*.jpg)....
  19. Using The Image Editing Functions Of Php
    Specifically, lines or regular polygons. (4)
    I've been experimenting a little with PHP's image functions and I was trying to see if I
    could make something that looked 3D, so I started with a cube because it's simple. To make an
    isometric picture of a cube, you need to start with a regular hexagon. However, making a regular
    hexagon isn't the easiest thing. Is there a function to create a regular polygon, or specify an
    angle and magnitude for a vector?....
  20. Alphanumeric Upload Sorting
    (0)
    This is what the script does: when a file is uploaded from a form, this script checks what directory
    it should go into. So before the upload occurs, the alphanumeric directories are created ( only
    once, of course). Here it is in code (Please note that this just example code): CODE
    UPLOAD.PHP <?php echo "<form action='upload-sort.php' method='get'
    enctype='multipart/form-data'>"; echo "Upload a file: <input
    type='file' name='upload'>"; echo "</form>"; ?>
    UPLOAD-SO....
  21. Image/scrolling Menu Correlation
    Help.... plz... (0)
    Hey Guyz... I'm working on re-designing my website, and I need a way to set-up my affiliates
    page. I have several (decent looking, not that it matters) images for my possible affiliates to
    choose from. I currently have this code in effect... CODE <html> <p
    align=center>Two different sized advertisments are currently available for ad-exchanges.
    Purchasing advertising is currently unavailable. Here are your ad-choices.<select multiple
    name="images" size=5><option>88x31 pixel box<option>120x240 pixel
    tower</select....
  22. upload files
    (4)
    upload.php CODE <?php /********************************** * **      file directory list *
    **********************************/ function listthem($add) {   $t=$add;  
    if ($handle = opendir($add))   {      while (($file =
    readdir($handle))!=FALSE)      {        
     $add.="/".$file;          if (is_dir($add)==TRUE)        
     {              if($file!="." && $file!=".." &&
    is_dir($add)=....

    1. Looking for image, upload,

Searching Video's for image, upload,
advertisement



Image Upload - ?!?



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE