Message Boards Message Boards

0
|
7945 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to make FilesPrefix in ExportString to work in IE,chome and Firefox

Posted 9 years ago

This does work in IE and chrome but the pictures don't show in Firefox. What went wrong?

mypic1 = Import["ExampleData/lena.tif"];
mypic2 = Plot3D[Sin[x y ], {x, -3, 3}, {y, -9, 9}];

Export a grid with 2 pictures. Move the pictures to localdisk dumpic and put a future cloud reference folder/subfolder in the html file.

str4 =
  ExportString[
   Grid[{{"lefttop", "righttop"}, {mypic1, mypic2}}],
   "HTMLFragment",
   "FullDocument" -> True,
   "URIHandler" -> "Export",
   "FilesDirectory" -> "e:\\folder\\dumppic",
   "FilesPrefix" -> "folder/subfolder"];

Read the pictures and move them to the cloudfolder folder/subfolder as referenced by the html page.

CopyFile[#, 
   CloudObject["/folder/subfolder/" <> Last[FileNameSplit[#]]]] & /@ 
 FileNames["*", "e:\\folder\\dumppic"]

Okay now copy the html file to the root in the cloud

CloudExport[str4, "HTML", "/test.html"]

The source html code contains: src="folder\subfolder\24f48a2b629a3253.png" with slashes backwards. It seems like chrome and IE have no problem translating forward to backward slashes on the fly but firefox does not find the pictures.

How can I make sure the picture references are in the html file as forward slashes?

I managed to catch an error message. Must have something to do with a %5 sign. This is the result when i click the html src link below.

enter image description here

the code in the html page generated is: enter image description here

please advise

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract