issue in saving an xml
-
I had written about this earlier, but the application does not work.. I have the server return in its response, an url to an xml file, say urlPath = "http://abc.xyz.com/tmp/ordera5fgscfs122dfbvgefsdsd.xml" I want that when the client receives the url to an xml string in the response it saves the xml file to a particular location specified earlier; say folderPath = "C:\" I am using the following code: Dim xmlDocToSave As MSXML2.DOMDocument40 xmlDocToSave.loadXML (urlPath) xmlDocToSave.save (folderPath) But this is not saving the xml file into the folder location. Can anyone please help, I want to know how should I save the xml file sent by the server. It is urgent
-
I had written about this earlier, but the application does not work.. I have the server return in its response, an url to an xml file, say urlPath = "http://abc.xyz.com/tmp/ordera5fgscfs122dfbvgefsdsd.xml" I want that when the client receives the url to an xml string in the response it saves the xml file to a particular location specified earlier; say folderPath = "C:\" I am using the following code: Dim xmlDocToSave As MSXML2.DOMDocument40 xmlDocToSave.loadXML (urlPath) xmlDocToSave.save (folderPath) But this is not saving the xml file into the folder location. Can anyone please help, I want to know how should I save the xml file sent by the server. It is urgent
It's a bit difficult to follow your explanation. Is this server-side code and you're trying to save a file on the client machine? If so, then you can't do what you want. You have no control over where a client browser saves a file. You have to send the file in the Response stream with the proper encoding, then the browser will ask the user where he/she wants to save the file, just like if you were to download a .ZIP file.
Dave Kreskowiak Microsoft MVP - Visual Basic
-
It's a bit difficult to follow your explanation. Is this server-side code and you're trying to save a file on the client machine? If so, then you can't do what you want. You have no control over where a client browser saves a file. You have to send the file in the Response stream with the proper encoding, then the browser will ask the user where he/she wants to save the file, just like if you were to download a .ZIP file.
Dave Kreskowiak Microsoft MVP - Visual Basic
Thanx for your reply. I got it working. This is a client side implementation. The client receives an url to an xml file in the response and wants to save the xml file. The changes I had to go were as follows Say for instance, the server return in its response, an url to an xml file, urlPath = "http://abc.xyz.com/tmp/ordera5fgscfs122dfbvgefsdsd.xml" I want that when the client receives the url to an xml string in the response it saves the xml file as follows, filePath = "C:\saved.xml" Now I am using the following code: Dim xmlDocToSave As New DOMDocument40 xmlDocToSave.Load (urlPath) xmlDocToSave.save (filePath) This will save the contents of the xml in 'saved.xml' in C:\