# Upload files

**URL:** <https://forum.kirupa.com/t/upload-files/188872>\
**Category:** Uncategorized\
**Created:** [May 11, 2006, 2:18pm UTC](https://forum.kirupa.com/t/upload-files/188872 "2006-05-11T14:18:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MyDNA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MyDNA](https://forum.kirupa.com/u/MyDNA)\
**Post date:** [May 11, 2006, 2:18pm UTC](https://forum.kirupa.com/t/upload-files/188872/1 "2006-05-11T14:18:39Z")

</div>

i came acrross a tutorial about getting files from my database and create a xml file from this data. That works fine. now i like to add data to my database my knowledge reaches that also…  
But now i like to upload an image to a location on my server and when i upload this file it must automattically add the directory of the file to my database so the xml.php file can add it as a xml record and automatically add it in my flash site as an image.

for example all the images must be in the directory “images/” and this directory and filename must be added to the database.  
Does everybody can follow me?

Is there someone who can help me true this problem so i can find a solution.

Kind regards Jos:rabbit:

---

<div class="post-metadata">

**Author:** ![shiftedfocus](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@shiftedfocus](https://forum.kirupa.com/u/shiftedfocus)\
**Post date:** [May 12, 2006, 1:08am UTC](https://forum.kirupa.com/t/upload-files/188872/2 "2006-05-12T01:08:31Z")

</div>

First you want to create a html form that uploads an image.

```auto

<form enctype="multipart/form-data" action="upload.php" method="post">
        <p class="left_feature">Select image to be uploaded<br />
    <input type="file" name="upload" /></p>
    <input type="submit" name="submit" value="submit" />
    </form>

```

Then you want the php script to check for errors and then write the file name to a database using the INSERT sql statment.  
Then you want to use the move\_uploaded\_file function to move the image from the temp folder to the folder you swf files reads from, have a look on google lets loads of scripts.
