设置文件服务器以与iOS应用程序集成

设置文件服务器以与iOS应用程序集成

本文介绍了设置文件服务器以与iOS应用程序集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我需要设置服务器,以便可以从iOS应用程序上传文件。我不知道如何最好地进行。我想到FTP,但不知道如果有一个更好的选择。I need to set up a server so that files can be uploaded from an iOS app. I don't know how best to proceed. I thought about FTP but not sure if there is a better option.任何想法赞赏 GC我必须补充说,我将​​构建iOS应用程序,所以可以在我的代码中使用服务器API。Also I must add that I will be building the iOS app so can use server APIs in my code.推荐答案一个盲文件/ FTP服务器和硬编码的细节到您的应用程序,因为它需要是一个人拦截登录详细信息,他们可以访问您的服务器,他们可以上传(和潜在执行)的坏事。It's not ideal to set up a blind File/FTP server and hardcode the details into your app because all it takes is one person to intercept the login details and they have access to your server where they can upload (and potentially execute) bad things.一个可能的想法可能是在您的服务器上以您选择的语言(PHP,Ruby,Python或类似)设置一个API前端,您可以将图像POST到服务器。使用API​​前端,您还可以进行验证,以确保只有有效的图像正在上传,所有恶意的东西都会被丢弃。然后,在您的iOS应用中,您可以设置代码与API前端进行交互,并发送实际的图片,然后存储在您的服务器上。A possible idea could be to set up an API frontend on your server in a language of your choice (PHP, Ruby, Python or similar) where you can 'POST' images to the server. With the API frontend, you can also do validation to ensure that only valid images are being uploaded and all nefarious stuff is thrown away. Then, in your iOS app, you can set up code to interact with your API frontend and send the actual images which will then be stored on your server.这是一个相当概念的想法,而不是一个绝对的实现想法。它需要在服务器端有一些思考/阅读和更多的设置/编码。This is a fairly conceptual idea rather than an absolute implementation idea. It does require some thinking/reading and more setup/coding on the server side.编辑:只是为了添加,如果你只想要一个中央位置存储/图片,而不是基于每个用户对其进行控制,则您可能需要查看 Amazon S3 作为文件服务器。 Just to add, if you only want a central location to store/get your images without controlling it on a per user basis then you may want to look into Amazon S3 as a File Server. 这篇关于设置文件服务器以与iOS应用程序集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-23 19:18