Downloading multiple pdf files using wget fails (403 error) - pdf

I'm trying to download multiple pdf files from a web page (I'm using Mac OS X 10.6.1). Here is a example what I'm getting (www.website.org is just for example):
~> wget -r -A.pdf http://www.website.org/web/
--2009-10-09 19:04:53-- http://www.website.org/web/
Resolving www.website.org... 208.43.98.107
Connecting to www.website.org|208.43.98.107|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2009-10-09 19:04:54 ERROR 403: Forbidden.
~>
How can I overcome this 403 error? Should I use curl instead?

Perhaps you don't have permission to access the directory http://www.website.org/web/. Use this link in your web browser and see if you are redirected to a more specific URL. Then use that URL as input for wget.

Related

Minio uploads through the web interface and API receives "Unauthorized request."

I can successfully upload files to my Minio server using mc command line client (logged in as root):
./mc cp roobina.jpg minio/mag
roobina.jpg: 63.50 KiB / 63.50 KiB
But when I try to upload a file to a bucket using minio's own web interface I receive this error:
Unauthorized request.
When using api (in a php application using AmazonS3 libraries), I receive this error:
Error:Error executing "PutObject" on "https://s3.***.net/clbu/public/4d/4b/d1ad580690058a636ad58e5af931541336ec.jpg"; AWS HTTP error: Client error: `PUT https://s3.***.net/clbu/public/4d/4b/d1ad580690058a636ad58e5af931541336ec.jpg` resulted in a `403 Forbidden` response:
Forbidden (truncated...) Unable to parse error information from response - Error parsing XML: String could not be parsed as XML
Could someone please help?
After looking at different possible causes, I found that mod_security of apache (used as reverse proxy of minio:9000) was interfering with uploads causing the problem.
I disabled mod_security on the reverse proxy account and the problem is now solved.

Docker Rocket chat Rest api upload file error 413 Entity too large

I am using rocket chat rest API, every thing works good, but when i upload file to rocket chat rest api, it shows error 413 Request Entity Too Large, but when i upload file from website it uploaded any size of fie.
After checking all scenario, I concluded that file size less than and equal to 1 mb is uploaded successfully, and greater than 1 MB shows this error 413 Request Entity Too Large.
I upload file from post man using this url
https://rocket.chat.url/api/v1/rooms.upload/RoomId
Headers:
Content-Type:application/x-www-form-urlencoded
X-Auth-Token:User-Token
X-User-Id:User-Id
Form-Data:
file - selected file
Html result Error
<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>
when File successfully insert it shows following.
{
"success": true
}
After checking many scenarios and search many urls i get solution from this.
I have used rocket chat docker and I append one line to nginx config file.
Solution:
login to ubuntu server
write sudo nano /etc/nginx/nginx.conf and hit enter
Add or update client_max_body_size in
http {
client_max_body_size 8M; #used your exceeded limit instead of 8M
#other lines...
}
Restart nginx by command service nginx restart or systemctl restart nginx
Uploading larger file again, and it is successful.

Wget cant download file but browser can

I have an url like
http:\/\/23.246.50.145\/?o=AQFsBQ9SB1l-S4Ch0gw3lM0zSs4ReWo3_PsOqoF35YR0eHrAqxQ7GIRonzVp_nrrJ4m9cKer-YAmV-rgYJXHJ1NE9JjLqf78Jp7l9Y-z2njJVV2CpXDAPNoh91iqrDA2vRuNdlvYbbSJ4Sj5Mp-xiegEeAKXnQ&v=3&e=1494051078&t=XUSkPrEHFE2Tas3F9KxR7CPINPI
If i type this url in a browser it starts downloading a file that will named just download Which is actually a music file so i just rename it to .mp4
If I try to use wget it wont work
wget "http:\/\/23.246.50.145\/?o=AQFsBQ9SB1l- S4Ch0gw3lM0zSs4ReWo3_PsOqoF35YR0eHrAqxQ7GIRonzVp_nrrJ4m9cKer-YAmV-rgYJXHJ1NE9JjLqf78Jp7l9Y-z2njJVV2CpXDAPNoh91iqrDA2vRuNdlvYbbSJ4Sj5Mp-xiegEeAKXnQ&v=3&e=1494051078&t=XUSkPrEHFE2Tas3F9KxR7CPINPI"
Will get this error
--2017-05-04 09:10:51-- http://23.246.50.145/?o=AQFsBQ9SB1l-S4Ch0gw3lM0zSs4ReWo3_PsOqoF35YR0eHrAqxQ7GIRonzVp_nrrJ4m9cKer-YAmV-rgYJXHJ1NE9JjLqf78Jp7l9Y-z2njJVV2CpXDAPNoh91iqrDA2vRuNdlvYbbSJ4Sj5Mp-xiegEeAKXnQ&v=3&e=1494051078&t=XUSkPrEHFE2Tas3F9KxR7CPINPI
Connecting to 23.246.50.145:80... connected.
HTTP request sent, awaiting response... 420
2017-05-04 09:10:51 ERROR 420: (no description).
Why is this error?
I got forbidden. You must use ' instead of "
like
wget -d 'http://23.246.50.145/?o=AQFsBQ9SB1l-S4Ch0gw3lM0zSs4ReWo3_PsOqoF35YR0eHrAqxQ7GIRonzVp_nrrJ4m9cKer-YAmV-rgYJXHJ1NE9JjLqf78Jp7l9Y-z2njJVV2CpXDAPNoh91iqrDA2vRuNdlvYbbSJ4Sj5Mp-xiegEeAKXnQ&v=3&e=1494051078&t=XUSkPrEHFE2Tas3F9KxR7CPINPI'

Apache, mod_ssl "request failed: error reading the headers" for a specific user

Currently we have an Apache 2.2.3 server with mod_ssl 2.2.3 running Django, with users authenticating by using a x509 certificate.
So far the system is running perfectly except for a single user, who when trying to upload a file receives 400 Bad Request error, and the contents of the ssl_error_log regarding this operation are:
[<date>] [error] [client <client ip>] request failed: error reading the headers, referer: <referrer url>
The contents of the ssl_access_log are:
<client ip> - - [<date>] "POST <target page> HTTP/1.1" 400 321
Also, the user's browser is Firefox as far as I know.
I am completely unable to reproduce this bug and so far none of the other users have experienced it. Could you point out some reasons for this to happen?
I've experienced connectivity that stops the upstream after an X amount of bytes is sent. X was a pretty low value, as in enough to request some simple pages, but not to deal with ajax requests much less upload files. As far as I recall, this connectivity problem occurred only when tethering (from a specific Android phone, but I didnt even test other phones).
So if the upstream gets interrupted and the upload stalls, it makes sense apache would return this error, according to this post: "Apache waits a time equal to the Timeout directive (defaults to 5 minutes if not defined) for a response from the client. It is likely Apache is waiting for the CRLF that indicates the end of the headers, yet it is never received.."

php fopen: failed to open stream: HTTP request failed! HTTP/1.0 403

I am receiving an error message in PHP 5 when I try to open a file of a different website. So the line
fopen("http://www.domain.com/somef­ile.php", r)
returns an error
Warning: fopen(www.domain.com/somefile.php) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in D:\xampp\htdocs\destroyfiles\index.php on line 2
Your PHP app failed to authenticate. The request URI should be:
http://user:password#www.domain.com/somefile.php
It looks like your PHP client (i.e. the server on which your PHP script is running) isn't allowed to get http://www.domain.com/somef­ile.php, by the server on www.domain.com.