Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8918781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:50:12+00:00 2026-06-15T05:50:12+00:00

I am getting a POST https://www.example.com/php/download.php 405 (Not Allowed) with this ajax call to

  • 0

I am getting a POST https://www.example.com/php/download.php 405 (Not Allowed) with this ajax call to my php script. It is for a http file server that I wrote to download files…grab them outside of web root using php. My other PHP scripts/ajax calls work for my http file server…I am only getting this issue with this particular ajax call/php script. I am using Nginx.

Again, just to emphisize….On this same server other ajax calls and other php scripts work. So, kinda lost.

<?php

$path = "/trunk/";
$file = $_POST['filename'];
$file_ext = pathinfo($file, PATHINFO_EXTENSION);
$file_name = pathinfo($file, PATHINFO_BASENAME);
$file_full = $path . $file_name;

$finfo = new finfo(FILEINFO_MIME);

$ctype = $finfo -> file($file_full);
header('Content-Disposition: attachment; filename=\"$file_name\"');
header("Content-Type: " .$ctype);

readfile($file_full);

?>

187 
188 function downloadFile(event) {
189         var fname = event.target.getAttribute("href");
190         fname.replace("#","");
191         var form = new FormData();
192         form.append("filename", fname);
193         
194         var xhr = new XMLHttpRequest();
195         xhr.onreadystatechange = function () {
196 //              setTimeout(refresh, 500);
197         }
198         
199         xhr.open("POST", "php/download.php", true);
200         xhr.send(form);
201 }

Here is from Google’s chrome network debugger:

Request URL:https://www.example.com/php/download.php
Request Method:POST
Status Code:405 Not Allowed
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:172
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryNGHvOaUnlBV8ADWE
Host:www.example.com
Origin:https://www.example.com
Referer:https://www.example.com/index.php
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4
Request Payload
------WebKitFormBoundaryNGHvOaUnlBV8ADWE
Content-Disposition: form-data; name="filename"

CentOS-6.3-x86_64-minimal-EFI.iso
------WebKitFormBoundaryNGHvOaUnlBV8ADWE--
Response Headersview source
Connection:keep-alive
Content-Length:568
Content-Type:text/html
Date:Fri, 30 Nov 2012 23:59:59 GMT
Keep-Alive:timeout=300
Server:nginx
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:50:15+00:00Added an answer on June 15, 2026 at 5:50 am

    Your nginx config, check it. Your location blocks aren’t allowing you to access that file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem i'm facing right now is im getting a URL, like so: www.example.com/example.php?url=www.google.com
Via post (not get) method, i'mm getting id's in one file in php... How
I'm testing Salesforce's WebToLead form using this simple example http://wiki.developerforce.com/index.php/Simple_Web2Lead_Implementation . When I changed
I'm trying to POST a http request using ajax, but getting a response from
Referencing this post: ruby on rails average per day I'm getting the average per
I am getting data from iphone using php but when i insert post data
I'm referring to http://www.codinghorror.com/blog/2005/10/equipping-our-ascii-armor.html but I'm getting drastically different results. Does anyone know how
The PayPal IPN Guide documentation says clearly Post the request to www.paypal.com or www.sandbox.paypal.com,
In trying to implement the Twitter code at http://www.voiceoftech.com/swhitley/?p=681 I am getting a compile
I have been trying to follow the example in this post . Since I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.