• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ERAttachment.createERAttachment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERAttachment.createERAttachment


  • Subject: Re: ERAttachment.createERAttachment
  • From: Henrique Prange <email@hidden>
  • Date: Tue, 03 May 2011 08:50:45 -0300

Hi Jesse,

ERAttachment is an abstract class. You can't instantiate it using the createERAttachment method.

You should create the attachment using the ERAttachmentProcessor instead:

ERAttachment attachment = ERAttachmentProcessor.processorForType(storageType).process(editingContext, uploadedFile, originalFileName, mimeType, configurationName, ownerID);

Cheers,

Henrique

On 02/05/2011, at 15:30, Jesse Tayler wrote:

> I'm trying to create an ERAttachment via ERRest,
>
> I didn't see an ERRestRoute for uploading file attachments but maybe that's what I'm missing?
>
> I get a creation error while trying to create ERAttachment, and I realize I likely should be creating the ERAttachmentData object first, or more likely, find the ERRestRoute that's best for uploading a new file attachment?
>
>
>
> 		NSData posterData = (NSData)dic.valueForKeyPath("poster");
> 		ERAttachment attachment = ERAttachment.createERAttachment(editingContext(), true, new NSTimestamp(), (String)dic.valueForKeyPath("mimetype"), (String)dic.valueForKeyPath("filename"), false, sizeInteger, webPathString));
> 		user().setPoster(attachment);
>
>
>
> _______________________________________________
> 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

 _______________________________________________
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

  • Follow-Ups:
    • Re: ERAttachment.createERAttachment
      • From: Jesse Tayler <email@hidden>
References: 
 >ERAttachment.createERAttachment (From: Jesse Tayler <email@hidden>)

  • Prev by Date: ERAttachment.createERAttachment
  • Next by Date: Re: ERAttachment.createERAttachment
  • Previous by thread: ERAttachment.createERAttachment
  • Next by thread: Re: ERAttachment.createERAttachment
  • Index(es):
    • Date
    • Thread