On 18 Jul '08, at 12:23 AM, chaitanya pandit wrote:

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"

Safari isn't truncating the image's URL; it's actually giving you the URL that the image links to. (If the image isn't inside an <a> tag, you do get the URL of the image itself.)

Its the NSRTFDPboard type that contains the required data.

What that's giving you is just the filename, i.e. the last component of the URL. Given what I said above, you can't tack that onto the end of the URL you got from the pasteboard to get the image's location, because that URL probably points someplace else entirely. It just happened to work correctly in the one example you tried.

I distinctly remember filing a bug report about this back in 2005, and I less-distinctly remember that it was addressed in Safari 3. But I'm looking through the drag pasteboard now and I can't find where they put the image's URL. :-/

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to