简体   繁体   English

iOS 没有将音乐文件上传到我的服务器

[英]iOS does not upload a music file to my server

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).我正在尝试将文件从我的 iOS 设备上传到我的 IIS 网络服务器(Windows Server Web 2008),但由于某种原因,它没有收到大约 1 的请求,如果添加的文件似乎大于 a。

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.以前的上限是 2MB,现在大约是 10MB 左右。 All the settings in php that could have anything to do with this have been set to either 500MB or 6000 seconds timeout. php 中可能与此有关的所有设置都设置为 500MB 或 6000 秒超时。 The maxRequestBuffer for IIS has been set to 500MB aswell and should not be the problem. IIS 的 maxRequestBuffer 也已设置为 500MB,应该不是问题。

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:我的 Objective-c 代码是这样的:

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.经过一些测试,似乎 11.1MB(5 分 48 秒的声音)是最大的。 Any bigger than this will result in a failed upload.大于此值将导致上传失败。

Two main areas to check:两个主要检查区域:

  1. On the web server, check the logs.在web服务器上,查看日志。
  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.在客户端,我从来没有同步使用过 ASI,但是如果你切换到异步,你可以实现-requestFailed:委托方法并在调试器中分析错误 object。 (See the how-to ) (见操作方法

Also look in the HTTP request/response headers and see if anything interesting turns up.还要查看 HTTP 请求/响应标头,看看是否有任何有趣的事情出现。 HTTP Scoop is a useful tool for this if you are willing to part with $15.如果您愿意花 15 美元,HTTP Scoop 是一个有用的工具。 (I am not affiliated with the authors of HTTP Scoop.) (我不隶属于 HTTP Scoop 的作者。)

Also check any firewalls, filters, antivirus software, etc. between the client and the server.还要检查客户端和服务器之间的任何防火墙、过滤器、防病毒软件等。

To find the logs in IIS Open IIS Manager Click on the Web SITE (not the virtual directory) that holds your site.要在 IIS 中查找日志 打开 IIS 管理器 单击包含您的站点的 Web 站点(不是虚拟目录)。 As you are on windows 2008 you will have IIS 7.0 or 7.5, so you should see the "Logging" option under the IIS group Under Logging, there is a "Directory" option which is the path to the Logs正如您在 windows 2008 上一样,您将拥有 IIS 7.0 或 7.5,因此您应该看到 IIS 组下的“日志记录”选项是“日志”组下的“Directory to”选项,

If the log doesn't give you enough information, select other types of logs or increase the number of fields outputted.如果日志没有给你足够的信息,select 其他类型的日志或增加输出的字段数。 You may need to read Help to get an explanation of different fields.您可能需要阅读帮助以了解不同字段的说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM