Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Cannot Import XML from Website


This topic is 6151 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted (edited)

Can't get my head around this...

History

My application exports two files in XML format and the files are then posted on a ColdFusion powered website. I wish to import these two files into runtime copies of my application (on a regular basis), but due to the nature of the website where the files are hosted, the URL stays the same, but the files move location as they are updated, so I cannot point to an absolute path.

e.g http://www.website.com/media.cfm?mediaid=12510

when opened in a browser resolves to

http://www.website.com/media/xmlfiles/p/8/myfile.xml

As I said, when the files are updated, the old files remains (for rollback purposes) and a new file is created (mediaid remains the same, but now points to the new file location).

If I use Import Records from the file menu, select XML Data Source option, select File radio-button and paste the URL http://www.website.com/media.cfm?mediaid=12510 into the File Name box and press Open it will resolve fine and take me to the next step of Import Field Mapping. This is exactly what I want to do under script control, but I cannot. Obviously I want to hide the dialog, but if I leave it open and paste in the URL it works, but I cannot paste it in and expect it to work automatically, as it always fails.

Am I missing something here?

(Apologies for the length of the post)

Edit: the HTTP Request option doesn't work here, hence calling the File dialog.

Edited by Guest
  • Newbies
Posted (edited)

Update

I can make the URL a target of Web Viewer and see the resulting XML, so can I somehow grab the absolute path to the filename for here?

Appreciate any advice guys...

Edited by Guest
  • Newbies
Posted (edited)

SOLVED

Used GetLayoutObjectAttribute ( "WebViewerName" ; "Source" ) which returned the resolved URL including the target xml filename.

Also investigated WGET which turns out to be a very useful utility which downloads the xml file to the local machine.

I may actually stick to using WGET as it's proving to be more flexible (thank you Fenton Jones for mentioning WGET in one of your posts).

Edited by Guest

This topic is 6151 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.