How to enable PUT method?

#1
OLS v1.7.16 on Ubuntu. How can I enable http PUT so that I can upload files to the server. For example, so that this curl command works, "test.txt" is stored on document root.

curl -X PUT -F "file=@/home/intb/test.txt" http://myolsserver.com/test.txt

Currently it returns "Request Page Not Found"

Thanks
 
#3
Unfortunately openlitespeed disagrees. Even without network. From localhost, trying to PUT returns 501 Not Implemented.

Is there a special path after localhost/... for PUTs?


$ curl -v -X PUT http://localhost/ --data-raw "Raw data"
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 80 (#0)
> PUT / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.58.0
> Accept: */*
> Content-Length: 8
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 8 out of 8 bytes
< HTTP/1.1 501 Not Implemented
< content-type: text/html
< cache-control: private, no-cache, max-age=0
< pragma: no-cache
< content-length: 715
< date: Fri, 01 Dec 2023 17:51:00 GMT
< server: LiteSpeed
< access-control-allow-origin: *
< connection: close
<
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title> 501 Not Implemented
</title></head>
<body style="color: #444; margin:0;font: normal 14px/20px Arial, Helvetica, sans-serif; height:100%; background-color: #fff;">
<div style="height:auto; min-height:100%; "> <div style="text-align: center; width:800px; margin-left: -400px; position:absolute; top: 30%; left:50%;">
<h1 style="margin:0; font-size:150px; line-height:150px; font-weight:bold;">501</h1>
<h2 style="margin-top:20px;font-size: 30px;">Not Implemented
</h2>
<p>The requested method is not implemented by the server.</p>
</div></div></body></html>
* Closing connection 0
 

Cold-Egg

Administrator
#4
For static files, you probably can only use the GET request. For PUT, you might want to set up a backend service to handle it, e.g. PHP.
 
Top