开发者

405 Error uploading file

开发者 https://www.devze.com 2022-12-11 14:20 出处:网络
I am using Steve Sanderson\'s jQuery AJAX SWFUploader. I have got it all working for the most part, except the most important part.

I am using Steve Sanderson's jQuery AJAX SWFUploader. I have got it all working for the most part, except the most important part.

When I choose a file, it starts to upload (the progress bar advances) but then it give me a 405 error. Not sure why I get this error but I am using MVC here just like his example. I'm wondering if testing it locally I dont allow for PUT ?

Here is his 开发者_运维百科example...

http://blog.codeville.net/category/jquery/

Anyone have any ideas on how to resolve a 405?


Alright my problem was the following for anyone interested... since I am using MVC and testing on an XP box (lame) I have to use the .mvc hack. I forgot to include that in my upload_url value therefore it wasn't locating the action properly. I hope this helps someone.


Are you uploading to a directory with improper chmod permissions? I'd start by testing (assuming a dev environment) with chmod 777 on the directory the app is supposed to upload to.


In my case, the 405 error was due to a missing directory on my production server. It had nothing to do with my fetch request. My endpoint accepted post requests and that's in fact what I was sending, so the 405 error was a bit misleading. If in doubt, either comment out or throw a try/catch in suspect areas of your serverside code and retry until you find what's causing the problem if you're absolutely sure the request itself is properly formatted.

0

精彩评论

暂无评论...
验证码 换一张
取 消