473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

image in XML file

I've some XML files used to update my datas in my database/server.

I've got how to retrieve all datas between xml tags, but I'm stuck when I've
to retrieve images datas:

<DATAS>
.....
<PICTURES number=3 encoded=0> //0 is for plain jpg, 1 is for CDATA
Base64 string
<PIC name=pic1344_1.jpg number=1>
.....
</PIC>
</PICTURES
</DATAS>

how to save the image on the server ?

bob
Jul 17 '05 #1
3 3199
Bob Bedford wrote:
I've some XML files used to update my datas in my database/server.

I've got how to retrieve all datas between xml tags, but I'm stuck when I've
to retrieve images datas:

<DATAS>
.....
<PICTURES number=3 encoded=0> //0 is for plain jpg, 1 is for CDATA
Base64 string
<PIC name=pic1344_1.jpg number=1>
.....
</PIC>
</PICTURES
</DATAS>

how to save the image on the server ?

bob


put your base64 string inside a cdata tag
<pic>
<![CDATA[
....insert base64 string here...
]]>
</pic>
Jul 17 '05 #2
Hi Terence, thanks for replying
put your base64 string inside a cdata tag
<pic>
<![CDATA[
...insert base64 string here...
]]>
</pic>


The CDATA tag already exists. My problem is what to do with it !

Do I have to put the base64 string in a $variable then save it in a file,
most probably I must decode the base64 string....my problem is once I
encounter this tag, what should I do !

I've looked in php.net and google, but couldn't find any answer.

Bob
Jul 17 '05 #3
On Tue, 17 Aug 2004 09:37:46 +0200, Bob Bedford wrote:
Hi Terence, thanks for replying
put your base64 string inside a cdata tag <pic>
<![CDATA[
...insert base64 string here...
]]>
</pic>


The CDATA tag already exists. My problem is what to do with it !

Do I have to put the base64 string in a $variable then save it in a file,
most probably I must decode the base64 string....my problem is once I
encounter this tag, what should I do !

I've looked in php.net and google, but couldn't find any answer.

Bob


After reading the characters within the PIC tag (btw, why are all your
tags uppercase?) into a $variable, you may need to decode it (look at your
encoded attribute of the PICTURES tag). At this point, you have the image
data and file name. Open a file output stream, set the binary mode on the
stream, write the image data, then close the stream (this should
automatically flush the stream).

HTH,
La'ie Techie

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
11
by: bissatch | last post by:
Hi, I am trying to upload an image, create a new file based on that image and then store the base64 encoded image data in a database. I dont really know where my code is going wrong so I will...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
0
by: Duncan Welch | last post by:
I've got users uploading a file, which I then want resize, make a thumbnail out of, then delete. The image and thumbnail are working fine, but when I try to delete the image, I get an error: "The...
0
by: Satish Appasani | last post by:
Hi: I have a ASP.NET form with Web layout which I've achieved using panels. In one of the tab I have a File control to upload Images. When I put a file in the file control and move to another...
7
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
6
by: Patrick Dugan | last post by:
Hello, I'm trying to load different images (icons) into a PictureBox1.Image. The first image loads just fine, but the second image always returns the error "Invalid property used." It doesn't...
7
by: lgbjr | last post by:
Hello All, Im using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
1
by: bharathv6 | last post by:
i need to do is modify the image in memory like resizing the image in memory etc ... with out saving it disk as i have to return back the image with out saving it disk PIL supports the use of...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.