JQuery-File-Upload 404 Error on Delete

2019-08-22 03:31发布

问题:

I installed JQuery-File-Upload (and Backload) using NUGET into my VS2013 MVC 4.5.1 project.

The file upload works great and I successfully uploaded 3 files.

However, when I attempt to delete any of the files, nothing appears to happen on the page and Fiddler reports a 404 error.

Moreover, all the files exist and the folder and files within them have been set to EVERYONE with full control.

Also note, the message below specifies a path for backload's handler, but, the path doesn't exist ... should it?

C:\Projects\AustinTexasKarate\Web\Backload\UploadHandler doesn't exist.

Below are the results from Fiddler.

Note the error code: 0x80070002.

Does anyone know why delete doesn't work on my system or could provide clues? Did I miss something?

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

Most likely causes: •The directory or file specified does not exist on the Web server. •The URL contains a typographical error. •A custom filter or module, such as URLScan, restricts access to the file.

Things you can try: •Create the content on the Web server. •Review the browser URL. •Check the failed request tracing log and see which module is calling SetStatus. For more information, click here.

Detailed Error Information:

Module IIS Web Core

Notification MapRequestHandler

Handler StaticFile

Error Code 0x80070002

Requested URL
/Backload/UploadHandler?fileName=youth_lineup.jpg&uploadContext=C:%5CProjects%5CAustinTexasKarate%5CWeb%5Cfiles%5Cphotos

Physical Path
C:\Projects\AustinTexasKarate\Web\Backload\UploadHandler

Logon Method Anonymous

Logon User Anonymous

Request Tracing Directory
C:\Users\Roy\Documents\IISExpress\TraceLogFiles\WEB

More Information: This error means that the file or directory does not exist on the server. Create the file or directory and try the request again. View more information »

回答1:

Per the Backload FAQ, you can tweak your Web.config to enable DELETEs without 404ing:

<system.webServer>
  <handlers accessPolicy="Read, Write, Execute">
      <remove name="WebDAV" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,POST,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,POST,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,POST,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
    ...
</system.webServer>