How to download image files

This space is made available to users of Open Patent Services (OPS) web-service and now also to users of EPO’s bulk data subscription products such as 14. EPO worldwide bibliographic database (DOCDB), 14.11 EPO worldwide legal status database (INPADOC), 14.12 EP full text data, 14.1 EP bibliographic data (EBD)and more.

Users can ask each other questions, exchange experiences and solutions, post ideas. The moderator will use this space to announce changes or other relevant information.
Post Reply

nikhil
Posts: 24
Joined: Wed Sep 21, 2011 12:46 pm

How to download image files

Post by nikhil » Sat Dec 07, 2013 4:22 am

I am having difficulty downloading the image files when using authentication. For example, the image available at https://ops.epo.org/3.1/rest-services/p ... ng?Range=1 can be downloaded anonymously but not with authorization.

Is there some example command or code that I can use to download the images?


EPO / OPS Support
Posts: 1298
Joined: Thu Feb 22, 2007 5:32 pm

Re: How to download image files

Post by EPO / OPS Support » Mon Dec 09, 2013 9:43 am

Dear user,

You request should work in both environments. You don't need to use ?Range for clipped images because there is always only one representative image and that one is always on the first page anyway. But that can not cause your problems, it's just a remark.

We can not reconstruct your problem so please be so kind and repeat your search with the token and post for us your system's request and even more importantly, system response.

Kind regards,

OPS support


nikhil
Posts: 24
Joined: Wed Sep 21, 2011 12:46 pm

Re: How to download image files

Post by nikhil » Mon Dec 09, 2013 12:32 pm

Hello,

Thanks for the reply. I was trying the following curl command and it was not getting any data:
curl -H "Authorization: Bearer vh0TxLuixpzyFV3CVXWcBzxqzZIK" "https://ops.epo.org/3.1/rest-services/p ... stpage.png" -o image.jpg

I tried the following wget command and it worked fine:
wget --header='Authorization: Bearer vh0TxLuixpzyFV3CVXWcBzxqzZIK' "https://ops.epo.org/3.1/rest-services/p ... stpage.png" -O image.jpg

I think that there is some error in the curl command that I am trying. I have switched to using wget, and it works fine. For reference, it will be great if you could post the correct curl command.

This was just for testing and we will be implementing this is Java and/or PHP. I will get back to you if we face any further issues there.

Also, I have a suggestion / request - please release libraries for Java, .NET, PHP etc. which can be used to download data from OPS. The library can take care of all the rate limiting, fair use, access tokens etc. and expose a simple API to the user.

Regards,
Nikhil


EPO / OPS Support
Posts: 1298
Joined: Thu Feb 22, 2007 5:32 pm

Re: How to download image files

Post by EPO / OPS Support » Mon Dec 09, 2013 4:27 pm

Dear user,

Your can test your your commands onhttps://developers.epo.org/

You reply seems different than your original question, since you are now talking about two different documents, one working and one not working and in your original email you said that one and the same number is working as anonymous only - so which is it?

Kind regards,

OPS support


nikhil
Posts: 24
Joined: Wed Sep 21, 2011 12:46 pm

Re: How to download image files

Post by nikhil » Tue Dec 10, 2013 3:35 am

Sorry, my mistake, I mixed up a couple of different URLs. The initial problem that I needed help with has been resolved now.

BTW, I tried to remove the Range=1 as suggested by you but that seems to create a problem. In the browser, if I try https://ops.epo.org/3.1/rest-services/p ... stpage.png then I get

<fault><code>SERVER.EntityNotFound</code><message>No results found</message></fault>

However, https://ops.epo.org/3.1/rest-services/p ... ng?Range=1 works fine.


nikhil
Posts: 24
Joined: Wed Sep 21, 2011 12:46 pm

Re: How to download image files

Post by nikhil » Tue Dec 10, 2013 6:15 am

Update: We have been testing this some more and the behavior without Range=1 is inconsistent - it sometimes works and sometimes doesn't. Maybe the service is running on multiple servers and some of them expect Range=1 ?


EPO / OPS Support
Posts: 1298
Joined: Thu Feb 22, 2007 5:32 pm

Re: How to download image files

Post by EPO / OPS Support » Tue Dec 10, 2013 9:02 am

Dear user,

As far as is known to us you never need ranges with first page clippings, but you do need them with normal drawings. If you feel like you have better result using Range then you can use it. I don't think that inconsistency is due to what you said - send me few examples of those that don't work without Range so that I can have a look.

Kind regards,

OPS support


Post Reply