You can easily upload images using just your web browser - an FTP 
program is not needed.

You'll need a form with it's encoding set to multipart/form-data, e.g.

<form name="formAddTitle" method="post" action="save_details.php" 
enctype="multipart/form-data">
...
        <input type="file" name="imgCover">
...
        <input type="submit" name="cmdSaveTitle" value="Save Music Title">
...
</form>

and then within your receiving script you'll need something similar to:

$image_filename = $HTTP_POST_FILES["imgCover"]["name"];
move_uploaded_file($HTTP_POST_FILES["imgCover"]["tmp_name"], 
"my/save/location/" . $image_filename);

That's all there is to it. Assuming you're using PHP that is :)

FYI: I haven't done it myself but I think you can save images into MySQL 
using a BLOB field.

Neil



Emma Grant wrote:
> **************************************************************************
> This Message Was Virus Checked With : SAVI 3.58 May 2002 
> Last Updated 14th June 2002
> **************************************************************************
> 
> Hi All, 
> 
>        First of all I want to thank you all for all the help that you have given me 
>throughout the last week. 
>        
>        I have learnt a great deal, and through your help and the resources on the 
>interenet I have successfully been able to create and connect to a database through 
>MySQL on Linux. Create a user for that database. Inserted and updated values on the 
>command line, and I have learnt to insert, update and view the data from the database 
>through web form using CGI. (Thanks to those who taught me how to check for errors in 
>my scripts)
> 
> Just to think, I didn’t even know how to access MySQL last Thursday ☺ 
> 
> But as you expected, here comes my question;
> 
> I need to be able to insert images into the database through a FILE FIELD on a web 
>form. I have already tried this through a simple form that I created, but it only 
>inserts the actual location (eg C:Documents and 
>SettingsAdministratorDesktoppersonal.jpg) of the file that I am browsing for on my 
>computer. Is there some sort of syntax that I have to use that converts the image to 
>binary as it gets “inserted” into the database, and then can be read by any 
>program (ie, web browsers) as an image when I select it again from the database 
>through a SELECT query? 
> 
> Why would I do this you ask? (read on if you are interested) ☺ 
> 
> I know that many of you are about to tell me to store the images on my server, and 
>reference the location from my database field. As I have read many times throughout 
>my research. But I want the ability for the user to choose the images they want in a 
>database from the form field. I don’t want them to have to use a FTP program to 
>upload images, and then insert the image location. I want it to be a one-stop form. 
>That is part of my project. So if anyone can help, that would be great. 
> 
> Emma
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 


-- 
----------------------------
Work: [EMAIL PROTECTED]
Home: [EMAIL PROTECTED]

Web:  www.curvedvision.com
----------------------------


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to