-1

Say I have a user, and that user has an XML file which, among other things, includes the relative (to the XML file) path to one or more images stored on their local machine. I want them to be able to upload this XML file to a web server, and automatically upload the images.

So my XML file might contain:

<tag>Images\img_20120905_015463548.jpg</tag>

and I want to upload both the XML file and img_20120905_015463548.jpg in one operation.

The problem is, as best I can tell, I can't get a local web page to grab the images automatically using JS/jQuery due to the pesky web browser security model that won't allow me to upload arbitrary files off the local computer, or even know the real path of the XML file. After bashing my head against a brick wall for a few hours, I've come up with two possible solutions:

  • Upload the XML file, the server strips out the image file addresses and asks the user to locate each one. While it would get the job done, it's ugly and error-prone.
  • Use a batch file (or similar) to copy the XML file and images to a public-facing web server that the user can access on the local network, and then supply the public address of the XML file to my web server. It can then grab the images off the local public server. Problem: my IT department are too competent to allow users file access to public-facing servers. :)

Is there any solution out there I might have missed, that allows the user to upload multiple files given filenames only specified as a relative path?

Thanks in advance. :)

Juffy
  • 1,220
  • 13
  • 22

1 Answers1

0

If you are not restricted to a web-only solution, this would be achievable using a plugin or desktop application. For instance, a desktop .NET or Java WebStart application or a signed and therefore trusted Java applet would be able to access the local XML file and any associated image files, then upload them to the web server using a POST, web services or WebDAV.

Gnat
  • 2,861
  • 1
  • 21
  • 30
  • See also http://stackoverflow.com/questions/9895601/applet-frameworks-for-access-to-local-file-system – Gnat Oct 08 '12 at 21:50