File management best practices - c#

Hi I am currently working on a WPF application which needs extensive file management (users should be able to upload files to a central server and download files from that server)
currently i have created a fairly simple wcf based server to handle these requests.
i was wondering if there are any better ways to do this like third party apps or features in windows server, sql server, wpf that i am not aware of ...

Sql Server 2012 Has a new Feature on Top of FileStream, it's called FiledTables.
There you also have a fileshare which is syncronized with your filetable
Tutorial

For storing: Read about FILESTREAM capabilities in SQL Server 2008 for storing and accessing large files in SQL just thru file system.
For uploading/downloading: have no clue for you right now..

Have you looked at using WebDAV with IIS?

Related

Visual FoxPro data in .NET

We are in the process of migrating an old VFP application into a .NET WPF application with SQL server.
During the process we still need to read/write to the DBF files to keep our business working properly.
To do this, we use the standard OLEDB adapter that is available. However, our sysadmin is asking if we have an alternative way to access the DBF files.
Having each user connect to the files is not the best option from a network/security perspective. Specially when connecting from home through a VPN.
I've already tried to move the connection to a single server by exposing the data through an API. But that was slowing down the application too much. In some situations we synchronise the data through background jobs (Hangfire implementation). But this can be time consuming to implement.
Has anybody used any other techniques to do something similar while migrating a VFP application?
OLEDB is still the best option. Within the application, you could impersonate a specific user that has access to files.
Also Sybase Advantage Server can connect and work with VFP data files. Local mode is (was) for free and server mode paid. You might try checking that too.
Locate data on single PC as server. Access via RDP - kludges available to support multiple connections. Increase security if needed by connecting over VPN - then RDP.

File synchronization between c# application (.NET) and microsoft server

I am currently writing a c# application that includes file synchronization so that files can be provided for other clients and used offline. I thought of using the Microsoft File Sync Framework (.NET) to take care about the synchronization itself: https://msdn.microsoft.com/en-us/library/mt763483
We do have a MS server 2016 that could be used as a file server by creating a public share, but I am not sure if this is the correct way to do it (referring to security). I was also thinking about using (s)FTP or WebDAV to provide the files in order to have a secure connection. Is there a best practice how to do file synchronization in c# applications over the internet using a microsoft server without implementing your own server application?
Thanks in advance.
Using WebDAV finally worked great for me.

WPF C# MS SQL - DesktopVersion and Save/Load data to file

I have an application that currently runs in MS SQL Server Standard in multiple clients/local server. The program was builded using WPF + StoredProcedures/functions/triggers, and there aren't MS Jobs.
I want to create an desktop version of my application, where the user can save all the data to a file and load it in another desktop with the program running.
I never done this type of application before, and I have a few doubts about how I should do this, I don't know if what I'm planning is going to work.
Basically, I was thinking in install my application with SQL Server Express and to save/restore it to files, I thought about calling backup/restore database through storedprocedures.
Am I thinking right? Is there a better way to do this?
I'm not sure I understand why you would need to export the entire contents of the database to a file. The central database should be accessible by all of the client applications, avoiding the need for the client application to have its own dedicated copy of the database. But ... if this is really what you want, then I think your two options are:
1.) Use Backup+Restore.
2.) Use LocalDB with the AttachDbFileName property, which is designed to keep your database in a single self-contained local file that you can read/write without having to connect to an actual database server. Some starting info here.

Windows Form App - Which database type should I use?

I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx

easiest and/or safest way(s) to save a file to a backup server by code and how?

Full edit:
The scenario is that after uploading the file to the server via a secured web service, I'd like to save/create a copy of that file to another server in a LAN or another network.
I'd like to know what possible ways I could use to programmatically copy/create the backup of the file uploaded to the backup server (saving the file to the database would be the last option probably).
Here are a few details:
Files are of different types and sizes mostly text, documents and images that would be around a few KB to a couple of MB's.
Database is SQL Server 2008 R2 and the only way to connect to it is via calls to a secured WCF service.
Servers can be in the same LAN or on separate networks (depends on the client requesting).
The 2nd server is a redundant server and is using the 1st one as it's backup and vice versa.
Took me a while to find this post. Just map the drive to the backup server's shared folder and implement WindowsImpersonationContext.
How to Impersonate a user in managed code?
haven't seen security problems on this and doesn't need to mess with the HTTP/certificates.

Categories

Resources