upload images in database and folder

This is a discussion on "upload images in database and folder" within the PHP Forum section. This forum, and the thread "upload images in database and folder are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 11th, 2006, 09:28
New Member
Join Date: Jul 2006
Location: nepal
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Smile upload images in database and folder

hi, i have a problems that's problem is that i am want to upload images also in database to add and Attach folder, this code is finally worked to add images in Attach folder just not to add in database, may y have know any methed plz help me that.
yours regarded
dharmendra


<?
$pImage = $_FILES['upload']['name'];
if(isset($pImage)){
//echo "File Name: ".$pImage;
//echo "<br>File Temp Name: ".$_FILES['upload']['tmp_name'];
//echo "<br>File Size: ".$_FILES['upload']['size'];
//echo "<br>File Type: ".$_FILES['upload']['type'];
if($_FILES['upload']['size']<(50*1024)){
if(isset($pImage)){
$path="Attach/";
$arrImg=explode('.',$_FILES['upload']['name']);

copy($_FILES['upload']['tmp_name'],$path.$pImage);
}
else{
echo "Image size exceeds 50 kb";
}
}
}

?>
Reply With Quote

  #2 (permalink)  
Old Aug 11th, 2006, 16:06
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: upload images in database and folder

Depending on what exactly you want to do with the images, there are a number of php functions you need to be aware of. Go here and look at them:
http://uk2.php.net/manual/en/functio...opyresized.php
The page name in the url is just to get you to the right area. You will see all the graphic functions listed down the left-hand side of the page.

As far as database storage is concerned, I'm assuming you are using mysql so you will need to be defining your fields using a 'blob' field to store your image. It is also worth storing things like the file type, mime type, etc., as this will make future manipulation easier.
Reply With Quote
Reply

Tags
upload, images, database, folder

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Viewing images in folder R8515198 Web Page Design 8 Dec 6th, 2007 07:13
Developing a database & upload Aso Databases 8 Nov 23rd, 2007 06:59
Php image upload to database issue longstand PHP Forum 5 Nov 21st, 2007 09:45
Calling images in a banner from a folder ketansethi Flash & Multimedia Forum 4 Oct 28th, 2007 07:53
cannot update images in the folder begeiste PHP Forum 2 Sep 18th, 2007 18:38


All times are GMT. The time now is 21:10.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43