Architecture :: File/document Upload.download In A Web Farm?
Oct 11, 2010
I have an asp.net application running on a web farm that allows users to upload files and download them later via link to that file. Currently, I use Windows DFS to replicate the local IIS directory where the files are stored across the web farm servers. However, as this solution does not scale out, I want to implement a more scalable solution by partitioning the documents. Specifically, say I set up multiple file storage servers (Fs1, Fs2, Fs3, etc.) on the network. Further, let's say I change my upload page to save the uploaded file to one of the file storage servers on the local LAN (based on some logic). I assume so far I am safe with ASP.NET doing this much assuming I have the correct permission for the ASP.NET process ID. The question I have is withregards to download links. When a user gets served a download link to their document (e.g. http://www.testco.com/data/doc1.txt) is there a way for me to "intercept" that HTTP request and underneath the coversserve the doc1.txt from the file storage server (e.g. Fs2) it resides
I am working on a project where we want to provide link to download excel file.We are using NLB for load balancing,NLB cluster contains 3 machines.constraint is that excel file to be downloaded is available on a single machine.How to ensure that HTTP request underneath will served from the same mahine?
I've always been required show download size next to the file hyperlink. Only the file in question is rebuilt everyday and the file size can change often. So needless to say the size has been wrong for months. I'm not going to update our site daily to display needless info.
instead of
<a href="file.xxx">click here to download (20mb)</a>
I'd prefer
<a href="file.xxx">click here to download [sizeof('file.xxx')]</a>
The best solution would be javascript based or similar.
I have a web service I put together that has a custom soap header for the authorization (UserName and Password).I have a function currently that will allow a user to download a file from my site via a web service.I have integrated this download to the membership system of the site.They are using a vb.net front end client to perform the download.The files I download are around a meg in size.I would like to show the download progess of the file.I was going to setup MTOM and download the file in chunks.I am trying to get around the authorization of each "chunk" of data that I am sending down to the client.I do not want to hit my authorization process for all of these calls to the web service with the file offset.The authorization header works well for other functions I have put together for this web service.
They set a username and password and then call a function for specific data that I am making available via the web service.Is there an easier method to stream a file to a user and show the download progress of the file?I was going to generate a token and have that token passed per chunk,but I still have to go through my security process.Can anyone assist in the proper design of a webservice to stream a file with progress and passing credientials.
I am using webclient object to download a file to a windows folder from a sharepoint document library. The credentials I am passing to the webclient object are that of site collection administrator. everything works fine while i test it by uploading a file to the document library. But since the document library is email enabled; when an email is received the file is not transferred to the windows folder. i have put some workflow history events to see which user account is used when the email is received. the user account shown is the network service account. I have given write permissions on the folder to all the users; Everyone, Network service, the site collection administrator user etc. but still i cant figure out what is the problem.
I am not very familiar with the visual studio . I am doing a project in which i need to upload a documeant file to a database and also facilitate users to download them. Can anyone please let me know how exactly is this done. Or even storing the file in some location on the disk on server is fine.
How can I upload a file to a database (with as little code as possible!) along with a desciption of a file and then search through the descriptions to retrieve the appropriate files. Then how can I click on one and download it.I am not a very advanced programmer and would like full step by step code if possible not just a link to a website.
in the folllowing code i'm writing the file creation. but when i upload using filestream object it shows download dialog box every time. how to upload this file without download dialog box?
Dim sqlcon As New SqlConnection sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings("ClientAppl").ToString() sqlcon.Open() Dim sqlcmd As New SqlCommand sqlcmd.Connection = sqlcon sqlcmd.CommandType = CommandType.StoredProcedure sqlcmd.CommandText = "CSMS_USP_ViewstatusReport" sqlcmd.Parameters.AddWithValue("@P_Comp_id", txtComplaintID.Text) Dim da As New SqlDataAdapter da.SelectCommand = sqlcmd Dim ds As New DataSet da.Fill(ds) Dim viewer As New Microsoft.Reporting.WebForms.ReportViewer() Dim rptDataSource As New Microsoft.Reporting.WebForms.ReportDataSource("Consolidated_Report_CSMS_USP_ViewstatusReport", ds.Tables(0)) viewer.LocalReport.DataSources.Add(rptDataSource)
I have a scenario which I am looking at where large files which are about 30-40 MB are being FTPed to a server. I am looking at creating a .net screen with the FTP control to upload the file to a Unix server. I need to know how much of a performance hit it is to work with such large files, is it a feasible option in this scenario? I might have to create a .net component for the same and call from ASP application. Is it doable?
I have this scenario. I have an application running in a webserver (in DMZ). End users upload documents to the webserver. right now all the documents get stored in the webserver itself. I would like to store all the docs in the database server.
What is the best way to store the documents, move it from webserver to db server after they uplocaded or directly upload to the db server ?.
And, if I have to upload directly to the db server could someone help me how to mangae the connection to the db server and credentials..?
I have a gridview that allows the user to export this gridview to excel. Here is my codes but I would like my user to be able to select where to download the file
Protected Sub ExportToExcel(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click lblMsg.Visible = True Try Dim objSw As New StreamWriter(txtFileName.Text.Trim + ".xls") 'Dim serverFilePath As String = "D:Excel Files" 'Dim fileStream As New FileStream(serverFilePath, FileMode.Open) 'Dim fileSize As Long = fileStream.Length 'Response.ContentType = "application/octet-stream" 'Response.AddHeader("Content-Disposition", "attachment; filename=""" & txtFileName.Text.Trim & """;") 'Dim fileBuffer As Byte() = New Byte(fileSize - 1) {} 'fileStream.Read(fileBuffer, 0, CInt(fileSize)) 'Response.BinaryWrite(fileBuffer) 'fileStream.Close() 'Response.[End]() Dim objDt As DataTable = DirectCast(Session("Data"), DataTable).Copy() 'Get No Of Column in GridView Dim NoOfColumn As Integer = objDt.Columns.Count...........................
I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.
This works great for session state but my next challenge is Cache
My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.
There are two challenges that I face
1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.
2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.
For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.
My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.
Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?
I am using the async file upload control to upload to a image file. I want the user to upload only jpg files. And for that I am checking the uploadedfile content type in server side, after the upload complets. I wanna check this, before upload starts. There is one javascript method
function startUpload(sender, args){}
but how to access the content type of the file selected by user.