Tag: upload

C#使用FTP上传整个目录

我想要做的是在C#(C Sharp)中使用FTP上传网站。 所以我需要上传文件夹中的所有文件和文件夹,保持其结构。 我正在使用这个FTP类: http : //www.codeproject.com/Tips/443588/Simple-Csharp-FTP-Class用于实际上传。 我得出结论,我需要编写一个递归方法,遍历主目录的每个子目录并上传其中的所有文件和文件夹。 这应该将我的文件夹的精确副本复制到FTP。 问题是……我不知道怎么写这样的方法。 我以前写过递归方法,但我是FTP部分的新手。 这是我到目前为止: private void recursiveDirectory(string directoryPath) { string[] filePaths = null; string[] subDirectories = null; filePaths = Directory.GetFiles(directoryPath, “*.*”); subDirectories = Directory.GetDirectories(directoryPath); if (filePaths != null && subDirectories != null) { foreach (string directory in subDirectories) { ftpClient.createDirectory(directory); } foreach (string file in filePaths) { […]

使用entity framework将文件保存在数据库中

我有一个基于Entity Framework和Microsoft SQL Server 2008的ASP.NET MVC解决方案。我需要创建一个允许我的用户上传文件的function。 我想要的是: 使用entity framework在数据库中存储文件的解决方案 一种解决方案,可以检测并阻止通过某种散列/校验和上载同一文件两次 关于数据库/表格设计的提示

无法将大型文件上传到Google文档

我将文档上传到Google文档: DocumentsService myService = new DocumentsService(“”); myService.setUserCredentials(“username@domain.com”, password ); DocumentEntry newEntry = myService.UploadDocument(@”C:\Sample.txt”, “Sample.txt”); 但是当我尝试上传3 MB的文件时,我得到一个例外: Google.GData.Client.dll中出现“Google.GData.Client.GDataRequestException”类型的未处理exception。其他信息:请求执行失败: http ://docs.google.com/feeds/documents/private/full 如何将大型文件上传到Google文档? 我使用的是Google API ver 2。

Unity3D – 将图像从PC内存上传到WebGL应用程序

我需要用户将他(她)的头像图片从PC上传到游戏 如何创建文件对话框并将图像上传到WebGL游戏?

从FTP上传文件和下载文件

我正在尝试制作一个上传/下载.exe文件到FTP 我尝试使用FtpWebRequest ,但我只能成功上传和下载.txt文件。 然后我在这里找到了一个使用WebClient下载的解决方案: WebClient request = new WebClient(); request.Credentials = new NetworkCredential(“username”, “password”); byte[] fileData = request.DownloadData(“ftp://myFTP.net/”); FileStream file = File.Create(destinatie); file.Write(fileData, 0, fileData.Length); file.Close(); 该解决方案有效。 但我看到WebClient有一个方法DownloadFile没有用。 我认为因为它仅在HTTP上不适用于FTP 。 我的假设是真的吗? 如果没有,我怎么能让它工作? 有没有其他解决方案使用FtpWebRequest上传/下载.exe文件到ftp?