• 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
Image Name retrival from web-page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Image Name retrival from web-page


  • Subject: Image Name retrival from web-page
  • From: ramya laxmi <email@hidden>
  • Date: Fri, 23 Dec 2005 18:45:21 +0530

Hi,

Ur right...,
When the user drags the image from webpage, the filename and image are
stored in pasteboard.

We can retrieve the file name thru :
NSArray *urlArray = [pasteBoard propertyListForType: NSURLPboardType];
NSString *imageNameTemp = [[urlArray objectAtIndex: 0]
lastPathComponent];

This gives u the exact file name.

To retrieve image:
NSData *carriedData = [pasteBoard dataForType:NSTIFFPboardType];
NSImage *image = [[NSImage alloc] initWithData:carriedData];

This gives the image.

But when an image-link(Image-link = whn u click the image u move to some
other page) is dragged
and dropped ,
iam getting the image correctly,
but the above code for file name retrival is not working.
[Actally , instead of filename its returning the link-path lastComponent].

How to get the correct file name.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Zero kb file copied
  • Next by Date: HIG-compliant image highlight
  • Previous by thread: Re: NSOpenPanel runModalForTypes: argument
  • Next by thread: Re: Image Name retrival from web-page
  • Index(es):
    • Date
    • Thread