Re: uploading with ERAttachment ???
Re: uploading with ERAttachment ???
- Subject: Re: uploading with ERAttachment ???
- From: Johann Werner <email@hidden>
- Date: Wed, 14 Jun 2017 12:01:09 +0200
Hi Ted,
you can easily serve the HTML file back to the client by creating a ERXResponse
object and setting the content to the content of the file. The problem comes
with the referenced images as your /clientFiles/attachments/e/f/e/4 directory
is (probably) not within your webserver’s htdocs but only reachable by the
application server. That means that the references to the images cannot be
resolved by the webserver. If you look at WOImage you can see how WO is solving
this by using a special request handler that returns the requested resource
from the app.
You could parse the HTML file and try to replace every pseudo local URL with
one that will deliver the specific resource via the resource manager of a
direct action.
jw
> Am 12.06.2017 um 18:11 schrieb Theodore Petrosky <email@hidden>:
>
> I am uploading .zip files with ERAttachment. Everything is working fine. But
> now I need to do more.
>
> I figured out how to unzip the archive so I end up with:
>
> /clientFiles/attachments/e/f/e/4.zip the uploaded zip and
> /clientFiles/attachments/e/f/e/4 as a directory. Inside this directory I have
> a couple of files.
>
> index.html
> pict1.png
> pict2.png
> logo.png
>
> Ok, so obviously this is a web page that lives at:
> /clientFiles/attachments/e/f/e/4. If I navigate to the folder and double
> click the index.html, I will get the page.
>
> I need to process the attachment.filesystemPath() to get to the index.html. I
> thought I could just parse the filesystempath() and read the file. That was
> easy, but didn’t give me what I wanted.
>
> What do I need to do to present the index.html as a webpage!
>
> Ted
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden