• 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
[SOLVED] Image name for drag and drop from Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Image name for drag and drop from Safari


  • Subject: [SOLVED] Image name for drag and drop from Safari
  • From: chaitanya pandit <email@hidden>
  • Date: Fri, 18 Jul 2008 12:46:04 -0400

Hi,
Thanks for your reply, Clipboard viewer did the trick,
Its the NSRTFDPboard type that contains the required data.

// Get the rtfd data, get the attachment and then get the attachment name from it
NSData *nameData = [[sender draggingPasteboard] dataForType:NSRTFDPboardType];
NSAttributedString *string = [[[NSAttributedString alloc] initWithRTFD:nameData documentAttributes:nil]autorelease];
NSTextAttachment *attachment = [string attribute:NSAttachmentAttributeName atIndex:0 effectiveRange:NULL];
NSString *name = [[attachment fileWrapper] filename];


-Chaitanya

On 18-Jul-08, at 10:48 AM, Gary L. Wade wrote:

Launch the Clipboard Viewer, which is in:

   /Developer/Applications/Utilities/Built\ Examples/

and drop your images onto it, and then select the Drag Clipboard, possibly clicking Reload to inspect the values you can get.

Hi,
In my application, i allow users to drag and drop images from Safari,
however while receiving the drop i cannot retrieve the image name from
the pasteboard.
If i get the data for URL pasteboard type, it gives the URL up to the
image, and not containing the image, what i mean is,


if the image is located at suppose http://www.somesite/something/image.tiff
, the URL pasteboard gives http://www.somesite/something/
But  i need the "image.tiff"

I'd appreciate any help.
Thanks
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >RE: Image name for drag and drop from Safari (From: "Gary L. Wade" <email@hidden>)

  • Prev by Date: Re: Xcode style divider with embedded popup and pulldown menus
  • Next by Date: Re: Xcode style divider with embedded popup and pulldown menus
  • Previous by thread: RE: Image name for drag and drop from Safari
  • Next by thread: Flip animation like dashboard widgets
  • Index(es):
    • Date
    • Thread