简体   繁体   English

远程保存图片的最佳方法是什么?

[英]What is the best way to save pictures remotely?

I'm starting a new project in VB.NET and I need make this app connected to a server, initially 10 computers will access/feed the same database. 我正在VB.NET中启动一个新项目,需要将该应用程序连接到服务器,最初有10台计算机将访问/提供相同的数据库。 I'm using MySQL to write and read information, but I also need a place to save photos of the clients. 我正在使用MySQL编写和读取信息,但我还需要一个保存客户端照片的地方。 Every time that there's a new client, a photo should be taken of that person. 每次有新客户时,都应为该人拍照。 Every time a client goes to rent a bike, the worker should search and load its picture. 每次客户去租一辆自行车时,工作人员都应搜索并加载图片。

It is under development, and at this moment the app saves the photo in a web server, via FTP, what makes it slow to write and read. 它正在开发中,目前,该应用程序通过FTP将照片保存在Web服务器中,这导致写入和读取速度变慢。 So I'd like to know if there's a better way or service to do that? 所以我想知道是否有更好的方法或服务来做到这一点?

Thanks since now, Erik 从现在开始,谢谢

A couple options immediately spring to mind: 马上想到几个选择:

  1. Store the photo on a file system somewhere on the network which all client computers (the ones running your app) have a fast native file system connection to. 将照片存储在网络中某个位置的文件系统上,所有客户端计算机(运行您的应用程序的客户端计算机)都具有快速的本机文件系统连接。 If the server is a Windows machine, you don't need FTP, use System.IO. 如果服务器是Windows计算机,则不需要FTP,请使用System.IO。 Hardware-wise, a network attached storage (NAS) unit is the gold standard solution, but any PC/server connected to the network with a sufficiently large hard disk is acceptable. 在硬件方面,网络附加存储(NAS)单元是金标准解决方案,但是任何连接到具有足够大硬盘的网络的PC /服务器都是可以接受的。 File access over a Windows network will be quite fast. 通过Windows网络的文件访问将非常快。 You then just store your image with a name that can be programmatically determined from the user id or something else in the database, or if you really need to, store the name of the image in the database. 然后,您只需使用可以通过用户ID或数据库中其他方式以编程方式确定的名称存储图像,或者,如果确实需要,则将图像名称存储在数据库中。

  2. Store the photo in your database. 将照片存储在数据库中。 You may have to do some research to figure out how to do this with MySQL. 您可能需要做一些研究才能弄清楚如何使用MySQL。 It's certainly possible and acceptable to do this with SQL Server, but probably not ideal. 使用SQL Server这样做当然是可以接受的,但可能并不理想。

Also, as a side note, it may be worth figuring out why your FTP solution is slow. 另外,作为一个旁注,可能值得弄清楚为什么您的FTP解决方案很慢。 Is it the network? 是网络吗? Is it FTP implementation? 是FTP实现吗? Is it some other factor? 还有其他因素吗? FTP should be reasonably fast since that protocol was designed specifically for file transfer. FTP应该相当快,因为​​该协议是专门为文件传输而设计的。 So if the problem is with your infrastructure, it may affect any other solution you come up with. 因此,如果问题出在您的基础架构上,则可能会影响您提出的任何其他解决方案。 What I'm saying is, make sure you're solving the right problem. 我的意思是,请确保您正在解决正确的问题。 It would be a shame to invest in re-engineering the solution to find that it's still slow because you have a terrible network or something like that. 投资重新设计解决方案以发现它仍然很慢,因为您的网络糟糕或类似的东西,这将是可耻的。

暂无
暂无

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

相关问题 使用.Net和SQL Server 2005保存/加载图片的最佳方法? - Best way to save/load pictures with .Net & SQL Server 2005? 保存我的对象“学生”并将其加载到我的组合框中的最佳方法是什么? - What is the best way to save my Object "student" and load it into my combobox? 什么是保存/加载Windows窗体ToolStripMenuItem的最佳方法 - What the best way to save/load Windows Forms ToolStripMenuItem 远程控制/调试.NET应用程序的最佳方法是什么? - What is the best method of remotely controlling/debugging a .NET application? 什么是处理多实例Properties.Settings.Default.Save()的最佳方法 - What is the best way to handle Multi-instance Properties.Settings.Default.Save() 将电影对象保存在其他文件中并将它们与实际收藏夹中的电影对象相关联的最佳方法是什么? - What's the best way to save movie objects inside other files and associate them with the ones in the actual collection? 将对象列表保存到XML文件并使用C#加载该列表的最佳方法是什么? - What is the best way to save a list of objects to an XML file and load that list back using C#? 使用 Oracle 10g 保存和检索二进制文件的最佳方法是什么? - What's the best way to save and retrieve binary files with Oracle 10g? 保护Web服务的最佳方法是什么? - What is the best way to secure a webservice? 读取GetResponseStream()的最佳方法是什么? - What is the best way to read GetResponseStream()?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM