Downloading Pictures
I'm trying to download a gif image from the web and save to my servers hard drive. But I can't seem to fetch it correctly. I'm trying with.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Pictures In A DB
I am working on a website where people register to model for photogrpahers. As they register, I want them added to a list of other models, which will be stored in a DB, and retrieved with PHP. I would like to create a <table> setting, and have PHP list out their names in alphabetical order. My question is this. Do I put the pictures into the DB (MySQL), or keep them in a separate directory? I would then use a foreach statement to build the <table> sequence and the rest of the page.
MB/KB Of Pictures
I have an image gallery and want to have a php script that shows how much MB/KB of pictures have been served that day. I am guessing that you just read how much a certain directory has been accessed and count that.
Uploading 2MB+ Pictures
I have a site that has a picture album. It is hosted and I believe the php.ini file is set at the default of 2MB limit per file. With 5MP+ cameras out there many people have pictures that are over 2MB straight off the camera. As a convenience to the user, I would like to let them upload the pictures immediately after they pull them from the camera. I have the pictures resized to around 50k once they are on the server to conserve space and bandwidth. Unfortunately, I can't even get the files over 2MB onto the server. As you know, many people are clueless about resizing their pictures and won't go to the trouble. I want them to be able to use my site. Does anyone have any good tricks to move 2MB+ files?
Including Pictures Via PHP
Is there any way of including a jpg or gif file through php without using the code below? <?php include("/images/$id.jpg"); ?>
Pictures From XML File.
I've been able to parse the XML files used to update my database. Now, I receive image in XML files, like this: <PICTURES COUNT="3" CDATA="1"> <PIC NR="1"><![CDATA[/9j/4AAQSkZJ.....=]]></PIC> <PIC NR="2"><![CDATA[/9j/4AAQSk.............></PIC> <PIC NR="3"><![CDATA[/9j/4AAQSk.............></PIC> </PICTURES> How to save those 3 images in 3 jpg files ?
Pictures In MySQL
I am creating a code out of bits and pieces I found in somebody else's code, so I am not entirely sure how it behaves. <IMG SRC="picture.php?ID=1029&THUMB=yes"> picture.php: <? Header( "Content-type: image/jpg"); $linkID = mysql_connect("host", "user", "password"); mysql_select_db("database", $linkID); if(isset($_GET['ID'])){$ID=$_GET['ID'];}else{$ID=0;} $result=mysql_query("SELECT * FROM picture_base WHERE ID=$ID") or die("Can't perform Query"); $row=mysql_fetch_object($result); if(isset( $_GET['THUMB']){echo $row->THUMB}else{echo $row->IMG;} ?> The script works and displays pictures properly so I am happy with it. Its small and simple enough, my question is if not every site is saving their pictures in databases there must be a reason why, yes? And if I load picture.php?ID=1029&THUMB=yes as opposed to picture.php? ID=1029, will the script still load through the full sized image (in the IMG collum) and will that effect my traffic?
Random Pictures
i want to display random pictures every time a page is loaded, but i dont want the same ones shown again. so I setup a database and a 20 year unique id cookie and i log the id's of the pics shown in the db. now the problem is, that i use mt_rand to generate an id and show that picture. if the id has already been shown, by querying the db, what is the best way to get another random number that isn't in the db? do i have to do some kind of loop and getting generating random numbers until one isn't in the db yet? this might take a while if the user has almost seen all of them, it might take a while to get a random number that isn't one of the others.
Uploading Pictures
I want to create a web site where the user uploads photos. What is the proper way (I'm using php) to do this? I want to make sure the user doesn't upload viruses instead of pictures. Also want to be able to shape the pictures so that they are all the same size, no matter what size they are when the user uploads them.
Uploading Pictures
im trying to upload pictures but it does not record it in the database that a file has been attached for a particular bulletin. Dont want to view it, just record that its been attached. Code:
Pictures In A News-site
I'm going to start a news-system. I planned the database, but I'm not sure how to place the images into a generated form. The database (partial) is: article_id int author_id int date date title varchar (50) body varchar --> here comes the html source links, etc... It is a good way to place the image path into the html (img src...) and store the images in a specified directory, or easier to place the binary file into the database (pgsql)?? what is better for the body, the article in a html file, and in the database only the link or the html source in the database.
Using Php Generated Pictures With HTML?
I am able to create images with the use of the GDLIB. but I am not able to use these images together with HTML. I always get the message "headers are already sent.
Issue With Cache And Pictures
I have a problem with cached images... The script first creates some pictures out of avariable source (every time the script runs the pics are different): $im = imagecreatefromjpeg($file); imagejpeg($im2,"temp100.jpg",100); imagejpeg($im2,"temp75.jpg",75); imagejpeg($im2,"temp50.jpg",50); imagejpeg($im2,"temp25.jpg",25); then I show them using normal html img tags <img src="temp100.jpg"> The problem is that the pictures are cached and the script/IE shows a fautlhy version of the pictures. I tried messing with the header as described in the php manual. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); But this doesn't work... wrong pic-fileversion Does anybody has a sollution?
Uploading Pictures In PHP/MySQL
Does anyone know of a good tutorial that works or some sample code that works for this function? 1. Load photo to a file folder on the server 2. Load photo name to the mysql database 3. Resize photo on upload to a specific size I have found tutorials and sample code, but they don't work.
How To Thumbnail 1000s Of Pictures
I have a directory on my box with over 1000 pictures on. Now i wanna make a thumbnail of every picture,I started out just programming away, got all the names of the ".jpg" into an array and then looped throug while using the "ImageCopyResized" function first i got a timeout from the server saying ot took more than 30 secs to execute my script, then i used the "set_time_limit" function! But it still stops after having made about 50 thumbnails, i can't figure out whats wrong!! does anybody have any experience with this kind of operations??
User Uploading Pictures
I have a web site I am developing, and have a question. I would like members to be able to upload pictures. Do you think they should be saved as individual files or should they be put in an MySQL database? Which would you recommend, and do you have any sample code for accomplishing this?
Access Pictures From MySQL.
I'm planning on letting my users add pictures to their pages using the browser upload method. My question is, which is better? adding the picture to the database? or storing them on a separte directory and add a link to the page? I also will be letting each user have quota on the disk space.
Clicking Pictures To Appear In The Textarea.
I am trying to do a function where you click on the images and these are entered into the textarea. Exactly as if i was clicking on this above and it enters the code for the picture into this textarea.
Upload And Resize 2 Pictures
how can I upload and resize 2 or more pict in same time: if($_FILES["picture"]["name"][1]) { $dest = "../photo_dir/".$document_id."_photo[1].jpg"; copy($_FILES["picture"]["tmp_name"][1], $dest); } if($_FILES["picture"]["name"][2]) { $dest = "../photo_dir/".$document_id."_photo[2].jpg"; copy($_FILES["picture"]["tmp_name"][2], $dest); } ... but I want to these pictures been resized from original size (no matter what size) on upload to x= 100px y=100px - or other dimension.
Reading Pictures In A Folder
I'm trying to make a simple way to make a dynamic photo gallery function. This is my idea: First have a folder called Pics, in pics is a folder for images of different type (the criteria fun,events,nature) then in there I dump the images sorted by types in there with a basic numbering scheme of 01.jpg,02.jpg,03.jpg,04.jpg. Anyone got any ideas on a way I can read all the pictures in the subfolders and view them without having to give a count of images?
How Does Uploading Pictures Work?
Like myspace how does it "upload" the images I got a form to give it a try but was wondering as I am using local host I want to test it by uploading to my own hard drive as such... but unfamiliar on 2 things... 1) where should it be stored in the htdocs directory precisely? 2) how do sites like myspace etc with hundreds of pictures on their server's know which image is related to which profile ? Is it possible to test on local host? Or will i have to buy a real server firstly?
Load Multiple Pictures Into MySQL?
I'm trying to create a picture database for a site that I'm working on and I would like to do the following: - (main goal) Have a php script load an entire directory of photos into my mysql database in one swoop. - Display thumbnails on a general viewing page. - allow for viewing individual pictures by clicking on the thumbnails. <?php error_reporting(E_ALL); $id = $_REQUEST["iid"]; $link = mysql_connect("localhost", "root", "") or die("Could not connect: " . mysql_error()); mysql_select_db("mysql") or die(mysql_error()); $sql = "SELECT b1 FROM t1 where id in (1,2,3)"; $result = mysql_query("$sql") or die("Invalid query: " . mysql_error()); header("Content-type: image/jpeg"); while ($row = mysql_fetch_array($result)) { $fileContent = $row['b1']; $im = imagecreatefromstring($fileContent); $width = imagesx($im); $height = imagesy($im); $imgw = 50; $imgh = $height / $width * $imgw; $thumb = ImageCreate($imgw,$imgh); ImageCopyResized($thumb,$im,0,0,0,0,$imgw,$imgh,Im ageSX($im),ImageSY($im)); ImagejpeG($thumb); imagedestroy ($im); imagedestroy ($thumb); mysql_close ($link); } ?> It is only displaying one image.
Storing Pictures Generated Witn GD
I'm trying to make php store a picture (on the server) that have been resized by GD. The picture is downloaded from a browser. But I would like to store this file in different sizes. To save downloadtime and cpu-power I wish to do this only once while downloading the file to the server.I can resize files, but I'm unable to store them.
Read A Directory With 17'000 Pictures
I have the following problem with the simplified script bellow! When I start this script the first time files (~17000) are read in the /camera25 directory in less then 5 sec. When I click again on the same camera button ( second from the left), or reload button on the browser, I get a timeout from provider....
Select Pictures And Show Selected
I need to make a webpage (php) where users can select some excercises(with picture) out of 40, and then display a page with only the selected excercises (with their picture) that you can print.
Showing Pictures From A Mysql Database
I am trying to get pictures out of my database, they are not actually pictures in the database, but I think just a reference to them. I will show in my code. This is my PHP page I using to display them. Code:
Add 2-3 Pictures With Just 1 Article? (news- Publishing System)
Have a little problem here. I are about ot create an easy publishing system where the administrator can write down a happening, add some pictures and save it in a mysql db. I have created the article table, but my real problem is how to "connect" the pictures with the article? what should i use to get them connected to just one article? As a beginning i have this db: id (unique and primary key i guess i should set this to) when (the date event will happen) added (date of when the news where added) shortversion (a brief summary to use on the first page) maintext (the article and rest of the text.) then the problem: how to include images with this? 1. little thumbnail to use on the first page (about 50*50xp) and then some pictures to use inside the article, larger around 150. From 0 to a 2-3 should be possible. guess i should use a own table for the images, but how to link them with each other my head and I can just not understand så any help are appriciated !
Changing Pictures On Index-page When Reloading
I am a beginner but quite curious anyway. My problem: I have seen websites that show different pictures whenever you enter the site. By doing this, the sites look always fresh and attractive and I like the idea a lot. Now I like to have the same function on my site but I do not know how that works... Is there anybody who can give a good "explanation for dummies" on how to do that?
Upload And Resize Pictures With Path In Database
First I've must say Im completly new in php scripting What I need to do is upload, resize pictures with path in database Here is theory of it, and plan of doing it Hope somebody can help me here are 4 sizes of images: - newimagename1_1 with size W=100 and H=67 - newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6 with size W=308, H=208 - newimagename1 size W=308, H=208 - newimagename2, newimagename3, newimagename4, newimagename5, newimagename6 size W=500 and H=375 Code should go in this order: - check if folder with name "ID_of_user" exists - if it exists than upload images to it, if it doesn't then create it and upload images - array (image1, image2, image3, image4, image5, image6) - foreach(array) - if size of images are biger than W=500 and H=375 than resize them to W=500 and H=375m, if are not leave them as they are - copy (resized) images to same users folder with name "newimagename.jpg" - array (newimagename2, newimagename3, newimagename4, newimagename5, newimagename6) - for (newimagename1) - resize newimagename1 to W=308, H=208 - copy newimagename1 to same users folder with new name "newimagename1_1.jpg" - resize "newimagename1_1.jpg" to W=100 and H=67 - foreach(array) - resize array to W=150 and H=100 and copy them resized to same user folder with name "newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6" - conect to database - insert into database path of images (image1, image2, image3, image4, image5, image6, image7) values (newimagename1_1, newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6) - Delete (image1, image2, image3, image4, image5, image6) - Display images (newimagename1, newimagename2_2, newimagename3_3, newimagename4_4, newimagename5_5, newimagename6_6) with link to biger images (newimagename1, newimagename2, newimagename3, newimagename4, newimagename5, newimagename6) - Display image newimagename1_1
Using The Same Page To Display A Hundred Pictures One Picture At A Time
I have over a hundred pictures I would like to present. Is it practical to create and parse an array of pictures, picture paths, et al using server-side scripting to accomplish this? I created an array already, and whereby, the HTML and Javascript currently used amount to about 14KB for each of four different pages, the PHP page I started working on is already over 35KB in size (most of it is server side processing creating the array of pictures). What I'd like to do, is load the array only one time, and keep that loaded so the page doesn't recreate the array each time, thus minimizing the server side array creation. Also, I think I'm running into some problems whereby the javascript is messing up Google's parsing of the page. I don't see creating 100 different html pages as an answer, in the respect if something ever changes, that's one big mess to update and major portion of the content and alot of files. Am I wrong in trying to avoid doing it via strictly HTML pages? The pages exist at, and they represent swimming pools designed by the owner of Aquatic Creations (North Carolina In-Ground Swimming Pool Designers): Custom Swimming Pool Water Features http://aquaticcreationsnc.com/lib/php/viewing0.php Custom Designed Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing1.php Custom Designed Spas http://aquaticcreationsnc.com/lib/php/viewing2.php Custom Swimming Pool Features http://aquaticcreationsnc.com/lib/php/viewing3.php Stone And Tile Around Swimming Pools http://aquaticcreationsnc.com/lib/php/viewing4.php Does anyone have any suggestions on how to accomplish such or directions to pursue? If you could take a look as well and provide comments on the pages, I appreciate constructive criticism as well.
Downloading A .gif
I have a page with lots of thumbnails of photos. I want the user to be able to dload a big version of the photo (also present on the server) by either 1) clicking on it (left mousebutton) and have a 'save as...' dialog or 2) right-clicking on it and have a 'save as...' dialog. But I don't want the the whole photo to dload to the user before he is able to rightclick it. displaying the big photos as thumbnail and then right-clicking them is not an option since it takes ages for a page with thumbanils to build up... I am not sure if 1 is possible and not sure if 2 is possible... Can anyone give me a hint?
Downloading
I am cuurently trying to learn php and have created a site with an upload file facility, when they upload the file, my php script saves it on the server in a folder i dont wish to expose to anyone. now i need this folder to stay secret and not to allow the uploader to know what the new name of the folder is, this is all done. But when a person searches my site for uploads by keyword or description (which the original uploader set) and finds one he wants to download how can i create a script that allows them to download it but not show the path of the file they are downloading.
Downloading A Site
In php, is there anyway to download the HTML contents of a given site and store it in a variable for parsing? IE "download the msn.com HTML into $html_var and do this parsing code on it" ?
Downloading Files Through Php
I am creating a site that will allow me to download files from my computer through the web. The problem I am having is that these files are not within the websever's root directory, so I need to use a php command to read them from another directory. I gave the webserver permissions on the shared directory and I can view text files with the fopen command. What I need to do is be able to download binary files. I don't know what the command to do this would be as fopen and readfile will only display the file in a brower window and this doesn't work for binary files.
Downloading File
I was trying to download a file which I have created in the server. I was successful enough to retrieve it by using the header function but unfortunately, the content has been changed. Instead of the data that I inserted in it, it was changed into a html codes.
Downloading Counter
I just wanted to ask if it is possible to have a download counter wherein the counter adds 1 whenever theres is a successful download, not when the user click on the download button?
Downloading A File
How would I let someone download a file blah.extension, where the file contains something that is made in the script? For example: Grab database info Make coding Send it as blah.extension I don't know how to send it as blah.extension, I've tried header type, but I'm not sure how to get the exact extension.
PHP-FTP Downloading Files
I am trying to download a file to my local machine using PHP. However, when the script runs the file is placed in the folder assigned to the ftp user on the Web server instead of downloading to my local C drive. After the following script runs I find a file named C:TestShowID.txt in the user's FTP folder on the web server. Can some tell me why this happens? The local machine is a Windows XP machine. $ftp = (object) array( "host" = "ftp.mydomain.com", "user" = "user@mydomain.net", "password" = "password", "remoteFile" = "ShowID.txt", "localFile" = "C:TestShowID.txt" ); // Step one: Connect to the FTP server if(!is_resource($remoteRsrc=@ftp_connect($ftp->host))) trigger_error("Could not connect to remote " . "server {$ftp->host}", E_USER_ERROR ); // Step two: Log into the server if( !@ftp_login($remoteRsrc,$ftp->user,$ftp->password)) trigger_error("Could not log on to remote " . "server {$ftp->host}", E_USER_ERROR ); // Step Three: Attempt to copy remote file to local file if(@ftp_get($remoteRsrc,$ftp->localFile,$ftp->remoteFile,FTP_BINARY)) echo "Remote file successfully written to {$ftp->localFile}"; else trigger_error("Could not import remote file.",E_USER_ERROR); // Step Four: Close the connection ftp_close($remoteRsrc);
Uploading/downloading
I have made a database in mysql, and I can put files into it with a page wich is made with php. Uploading works, but not perfectly: files get damaged along the way.(for instance. I have a file 1229 bytes big, when I put it into the database it only is 1107 bytes big, and when I get it out of the database and save it onto my harddisk only 376 bytes remain).
Downloading Files
I need some code that will download a certain file, no matter what type it is. Currently, if it's say a .txt file it will open it in the browser, not download it. Is there a way to fix this in PHP?
Php Files Downloading
Can anyone suggest me why some .php files are downloading and some are executing. Ive got php 5.2.0 and apache 2.0.54. Apache came as an rpm along with Fedora 4. I downloaded php from the site and built it
Downloading Tif Files
how can this be done. if the href is to a *.zip file the "save as "prompt will open to prompt a download. so if a file is .tif. the browser will display this. what is the php code to do this simple task..?
Prevent Downloading
I recognized today that if I have an echo statement on an else at the end of my script the only thing which was downloaded by wget was this string. Is this a common way to prevent uncontrolled downoading of php scripts? The software I wrote is GPL licensed so I would share it as package not as partial files.
Ftp File Downloading...
im developing a site now... which capable of uploading files from client machine.. after downloading files... the creator/ client are capable of reviewing its uploaded documents.. guided by href links as a direct link to its file..... but my problem is how can i downloaded those files from the ftp? i try href="/folder/file.doc"> file.doc [/url] == > but the browser says "The website declined to show this webpage"
Downloading A File
I do not have many experience with PHP. What is the way to download a file? In my website I want to give access to my users to downlaod several files.
PHP/XML And Downloading Files
I am trying to read in a few XML's from a couple different poker sites and then trying to parse them to display the latest tournaments that are going to be happening. Is there any way I can just read in the file from http://tourneys.absolutepoker.com:8055/TourSchedule.xml to parse it. Right now I can only figure out how to copy and paste the file onto my server and then open it from there. Next, I am having problems parsing it. I am putting each attribute into a two dimensional array when I am parsing it, but I cannot access thi sarray outside of the function. I have the same echo statement inside the function and outside and it only prints it when it is inside the function. Code:
|