douyong8801 2011-07-13 12:00
浏览 45
已采纳

iOS不会将音乐文件上传到我的服务器

I'm trying to upload a file from my iOS device to my IIS webserver (Windows Server Web 2008) but for some reason it does not receive the request if the added file is bigger than a certain size (around 10MB it seems).

I have made a couple more questions about this matter and found a lot of answers from these. I still have a problem with the bigger files not being sent. The previous cap was at 2MB, now it's somewhere around 10MB or so. All the settings in php that could have anything to do with this have been set to either 500MB or 6000 seconds timeout. The maxRequestBuffer for IIS has been set to 500MB aswell and should not be the problem.

Looking at what i have changed allready I would think the problem lies in the app side not sending it at all. Previously the request would be sent and received by the server and the code would be fired, but the file would be ignored as it was too big at that time. However right now when i have a big file the request will not be received.

My Objective-c code is like this:

NSString *theUrl = @"myserverurl";
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:theUrl]];

[request setNumberOfTimesToRetryOnTimeout:2];
[request setShouldContinueWhenAppEntersBackground:YES];

NSTimeInterval timeOutSecs = 60000;
[request setTimeOutSeconds:timeOutSecs];

//[request setUploadProgressDelegate:(id)];

[request setFile:[soundFileURL path] forKey:@"mainfile"];
[request startSynchronous];

If anyone could tell me what is going wrong here it would help me alot! I couldn't find any methods allowing bigger files to be sent so any help on that would be great aswell! :)

Thanks in advance!!

EDIT

After some testing it seems that 11.1MB (5minutes and 48 seconds of sound) is the very maximum. Any bigger than this will result in a failed upload.

  • 写回答

2条回答 默认 最新

  • dongxiong5546 2011-07-13 15:09
    关注

    Two main areas to check:

    1. On the web server, check the logs.
    2. On the client, I've never used ASI synchronously, but if you switch to async, you can implement the -requestFailed: delegate method and analyze that error object in the debugger. (See the how-to)

    Also look in the HTTP request/response headers and see if anything interesting turns up. HTTP Scoop is a useful tool for this if you are willing to part with $15. (I am not affiliated with the authors of HTTP Scoop.)

    Also check any firewalls, filters, antivirus software, etc. between the client and the server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化