Skip to content

mediagur : Upload File and Get URL Free File Hosting with Uploading API. Upload a file to the mediagur platform and get the file URL.

Notifications You must be signed in to change notification settings

SH20RAJ/mediagur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mediagur : Upload File and Get URL

Free File Hosting with Uploading API. Upload a file to the mediagur platform and get the file URL.

Visitors

  • URL: https://mediagur.vercel.app/upload
  • Method: POST
  • Request Headers:
    • Content-Type: multipart/form-data

Request Body

  • Form Data:
    • file: The file to be uploaded. Supported file types: Any.

Response

  • Success Response:
    • Code: 200 OK
    • Content:
      {
        "url": "https://mediagur.vercel.app/files/abcdefg/file.jpg",
        "jsdelivr": "https://cdn.jsdelivr.net/gh/mediagur/abcdefg/file.jpg"
      }
  • Error Responses:
    • Code: 400 Bad Request
      • Content: { "error": "No file uploaded" }
    • Code: 500 Internal Server Error
      • Content: { "error": "File upload failed" }

Example

  • Request:
    POST https://mediagur.vercel.app/upload
    Content-Type: multipart/form-data
    
    ----WebKitFormBoundary7MA4YWxkTrZu0gW
    Content-Disposition: form-data; name="file"; filename="example.jpg"
    Content-Type: image/jpeg
    
    <Binary data of the file>
    ----WebKitFormBoundary7MA4YWxkTrZu0gW--
  • Response:
    {
      "url": "https://mediagur.vercel.app/files/abcdefg/example.jpg",
      "jsdelivr": "https://cdn.jsdelivr.net/gh/mediagur/abcdefg/example.jpg"
    }

Explanation

  • This API endpoint allows clients to upload a file to the mediagur platform using a POST request with multipart/form-data content type.
  • The uploaded file is stored on the mediagur platform indefinitely.
  • After successful upload, the API responds with a JSON object containing the URL of the uploaded file on the mediagur platform and a jsDelivr CDN URL for easy access to the file.
  • If no file is uploaded, the API returns a 400 Bad Request error with an appropriate error message.
  • If there is an internal server error during file upload, the API returns a 500 Internal Server Error with an error message.

Additional Notes

  • Uploaded files are stored indefinitely.
  • The jsDelivr CDN URLs provided can be used to access the uploaded files.

Contact

For any questions or support, please contact us at [email protected].

This simplified documentation focuses on the POST endpoint for uploading files and getting the file URL. You can expand this documentation with more endpoints, parameters, and detailed examples as needed.

About

mediagur : Upload File and Get URL Free File Hosting with Uploading API. Upload a file to the mediagur platform and get the file URL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published