Page 1 of 1

urgent need help about upload images

Posted: Wed Oct 15, 2008 3:24 am
by azeemgujjar
Hello Good Day To You!
i want to upload images to folder, and there path should be save in xml file.
xml scenario is like this

Code: Select all

 
<image>
    <A>
        <image id="img1" lbl="Illustrator" src="frames/a/A1.jpg" />
        <image id="img2" lbl="Fireworks" src="frames/a/A2.jpg" />
        <image id="img3" lbl="Lightroom" src="frames/a/A3.jpg" />
    </A>
    <B>
        <image id="img2" lbl="Fireworks" src="frames/b/B1.jpg" />
        <image id="img1" lbl="Illustrator" src="frames/b/B2.jpg" />
        <image id="img3" lbl="Lightroom" src="frames/b/B3.jpg" />
    </B>
so on.....
 


i will be greatly thankful if some one help me with this .... and give me some sample code...

Thank you

Re: urgent need help about upload images

Posted: Wed Oct 15, 2008 3:37 am
by requinix
Have you tried Google yet?

Re: urgent need help about upload images

Posted: Wed Oct 15, 2008 8:39 am
by azeemgujjar
i tried but not found :(

Re: urgent need help about upload images

Posted: Wed Oct 15, 2008 8:44 am
by aceconcepts
Not the best intial post i've seen!!!

Take a look at the sites (found via Google):

http://www.tizag.com/phpT/fileupload.php

http://uk.php.net/features.file-upload

Re: urgent need help about upload images

Posted: Wed Oct 15, 2008 12:27 pm
by azeemgujjar
file upload is not a problem on google we have thousands of ways, the problem is how to save uploaded file path to xml as i post.
i want when i upload image after complete it should be save its path in xml, like this...

<image>
<A>
<image id="img1" lbl="Illustrator" src="frames/a/A1.jpg" />
<image id="img2" lbl="Fireworks" src="frames/a/A2.jpg" />
<image id="img3" lbl="Lightroom" src="frames/a/A3.jpg" />
</A>
<B>
<image id="img2" lbl="Fireworks" src="frames/b/B1.jpg" />
<image id="img1" lbl="Illustrator" src="frames/b/B2.jpg" />
<image id="img3" lbl="Lightroom" src="frames/b/B3.jpg" />
</B>
so on.....

hope you understand now what i mean... please somebody help me

thank you for your precious time...

Re: urgent need help about upload images

Posted: Wed Oct 15, 2008 3:55 pm
by omniuni
How do you plan to get the information that goes along with the image?

Still, if you know where the image is going, it should be a simple matter of constructing a string and writing it to a file.

Assuming you are on PHP5+...

1. Read current file into a variable: $oldxml = file_get_contents('source.xml');

2. Modify String to include new data: $newxml = $oldxml.'<img><image id="'.$imageID.'" src="'.$imageSOURCE.'">.... (etc...)

3. Write back into the original file: file_put_contents('source.xml', $newxml);

Does that help a bit?

Re: urgent need help about upload images

Posted: Thu Oct 16, 2008 4:18 am
by azeemgujjar
thank you omniuni!
its really helpful for me, to understand what i need to do, thanks again...