Hi Ted,

With the caveat that I don’t use ERAttachment in a D2W setting...

On 22 Nov 2016, at 10:52 PM, Theodore Petrosky <tedp...@yahoo.com> wrote:

> I have a ERAttachment relationship and I am upload assets. I need to upload 
> .zip files and process them after they arrive. I need to unzip them. the 
> contents of the zip is a webpage (index.html and images). Hopefully, I can 
> unzip the file, and provide a link to this folder to view the webpage.
> 
> The filesystempath of erattachment looks like this:
> 
> /clientFiles/attachments/b/8/5/5.zip
> 
> if I end up with 
> 
> /clientFiles/attachments/b/8/5/5
> 
> as a directory, I should be able to create a link to that folder.
> 
> or am I barking up the wrong tree?

I think you might be barking up the wrong tree. ERAttachment is really designed 
to represent a single file. (For example, the ERAttachment EO itself has 
attributes like size, thumbnail, width, height, mimeType.) You might be able to 
beat it into your use case, but there’s probably a better way of doing it.

> how can i unzip this file after the uploads succeeds?


As a separate question, you can certainly do this. But you’d need to forget 
about using a component that automatically creates an ERAttachment, and use one 
of the regular upload components, like AjaxFlexibleFileUpload. You can then 
grab the InputStream provided by that component and do whatever you like with 
it. You can even later create ERAttachments from your post-processed files.

So, the summary is: I don’t think you’re going to win by trying to make an 
ERAttachment point to a filesystem directory, but everything else you’re 
talking about is completely possible.


-- 
Paul Hoadley
http://logicsquad.net/
https://www.linkedin.com/company/logic-squad/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to