Resolved fopen(http url) getting a 403 - forbidden

Status
Not open for further replies.

munimadx

New Member
Messages
17
Reaction score
0
Points
1
Hello!

We have found that, since this week, when we try to read an external http resource using fopen(url) it throws a 403 - forbidden code. This resource is downloadable with a normal browser.

May be a new security measure or something?

Thank you
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
It's hard to say because that depends on the server on the other end. Can you try your same code with something like http://microsoft.com or another well-known website?
 

munimadx

New Member
Messages
17
Reaction score
0
Points
1
True. I can download other csv's but not that one (403). But I am able to download it from my browser...
May be the site is filtering my request for some reason...

It's hard to say because that depends on the server on the other end. Can you try your same code with something like http://microsoft.com or another well-known website?
It's hard to say because that depends on the server on the other end. Can you try your same code with something like http://microsoft.com or another well-known website?
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Could be a simple user-agent block, in that case. Changing the user agent to evade a 403 would be something an administrator might be watching (and banning people) for, so that might not be a good solution. It would be best to contact the site and see if they have a proper API or policy for automated requests.
 

munimadx

New Member
Messages
17
Reaction score
0
Points
1
Yes! That was It, setting the user agent made It work.

I wonder why they set that policy, may be It was accidental, I Will look into It.

Thank you!
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
OK, take care and make sure you're not violating this website's TOS. If they consider it a violation and report it to x10, I would anticipate your account being suspended.
 
Status
Not open for further replies.
Top