Re: Image Name retrival from web-page
Re: Image Name retrival from web-page
- Subject: Re: Image Name retrival from web-page
- From: ramya laxmi <email@hidden>
- Date: Fri, 23 Dec 2005 21:33:46 +0530
Hi,
For image-link ,the last path component is returning the link-path's last
component....
i.e Consider the following image-link code in HTML:
<a href="/tunesLogo.html">
<img src=logos/winter_3.gif width=431 height=120>
</a>
I want "winter_3.gif" , but "tunesLogo.html" is returned when I used the
code for retrival of image.
-Ramya.
On 1/23/05, Janakiram <email@hidden> wrote:
>
>
Hi,
>
What is the value returned for the last component. Check that if
>
it
>
may solve your problem.
>
>
-JanakiRam.
>
>
On 23-Dec-05, at 6:45 PM, ramya laxmi wrote:
>
>
> 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:
>
> 40effigent.net
>
>
>
> This email sent to email@hidden
>
>
_______________________________________________
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