473,804 Members | 3,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3239
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
11769
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 table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
11
3253
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 just display it below: The following code contains the script to process the uploaded file, the form to upload the file and then a few links to view the file from
15
31815
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 help. Regards
0
1651
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 process cannot access the file "c:\inetpub\wwwroot\pictures\1\21_orig.jpg" because it is being used by another process. " I'm using the Image.Dispose() method before trying to delete it; how do I free up this image? Thanks in advance,
0
2301
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 tab, I am loosing the file in the file control. So, I am putting the file in a Session: Session("PhotoFile") = filePhoto.PostedFile When the user comes back to the tab with the File upload, an Image control
7
3403
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
2148
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 matter what icons are loaded. The first always shows up and any icons after that give me the error. Here is the offending code: The "DestinationPath" variable is the full path and filename of the icon
7
11646
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
1
11097
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 StringIO objects being passed in place of file objects. StringIO objects are binary strings of variable length that are kept in memory so i saved the image in stringio objects the following code does that for gif image ...
0
10790
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 inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.