I have searched for answers and it seems everything is asp.net and webforms.
I'm trying to find an entity/MVC solution I have to assume they are similar.
I have a database which has the info for the file stored in SQL Server datatype Image. I already have all the code to attach to files to the right people as needed. The only thing I am missing is how to build the Download link.
The HTML View will look like this.
The information about the document will be in a table containing information like document name, type etc. It will also have a Download link. Once they click this link I would like to have the file served to them for download.
This is the part that escapes me when doing it in MVC. I have the document in a model incoming_file is the column that contains the document.
How do I force the download of everything in incoming_file when they click Download?
Related
I am looking for any help, so i am currently uploading a file which is either a pdf or a docx to a file server and storing the address in a sql database. I am now trying to allow the user to search the whole database and also the text in the documents that have been uploaded. I am struggling to find any solutions using asp.net core.
Does anyone have any ideas?
Depending how many documents you have this is probably going to be slow as hell.
You will want to look into building a full-text-index like lucene or importing the contents of the files into a SQL full text index.
There isn't a pre-made way to do this as it is complicated depending on specific requirements
I am working on a web Project using ASP.NET,C# and Telerik control.
I am using Telerik control telerik:RadAsyncUpload to upload multipe files
After clicking submit button I am saving that files in Database in bytes format.
When I want to Update this record...I am fetching that files from database and showing links for that file.
So that when I will click on link, file will get downloaded.
Is there any telerik control to delete these file?
You can use the File Explorer Control from Telerik, some samples you can find here:
File Explorer
Also you can use a custom "File Content Provider" for the communication with your database, a sample implementation you find here: Custom File Content Provider and here you will find the documentation.
Another way would be to create a button (next to your download link) which fire your delete method :-), maybe simpler if you only need to delete these files.
I have a template for a loan document that I have saved in the directory of my asp.net MVC website. When the user clicks a clients name, I would like the website to edit the xml document using the clients information, then download the file as a word document. Any suggestions on how to do this?
I am using Docentric Toolkit, which is a OpenXML based tool so no Word installation is necessary on the server. The tool comes with a MS Word Add-in, with which you can prepare templates with placeholders for data.
In your MVC application you then have to:
Prepare data model classes (e.g. with Entity Framework).
Create method which will read the data and fill the data model collection(s) as needed.
Call the method to generate Word document from the chosen template which is filled with data from data collection from step 2.
You can take a look at this CodeProject example, to see detailed steps and download a demo project.
I hope this helps.
hey i'm working on project in which I have webform which includes some editfields. I don't want to enter the data manually into that editfield. what I want is to extract data from a word document and fill that editfields. But the catch is, through which MS doc I fill the editfield?
Suppose We have a bunch of lectures uploaded on some page. so what should I do to retrieve the data from a particular document?
Is it necessary to open the MS-doc file first?
or I should download the file first?
If I goes with option 1 when should I have to use some library? what opens the file within browser, retrieve the data and the a pop-up message appears "the data has been retrieved now you can close the file". and next I can fill the form with that data.
or should I goes with the 2 Option when an individual hit the download button then the file will be stored into the local machine. how can I keep the track that which ms-file is downloaded or stored into the local machine?and is it necessary to open that file for retrieving the data again?
These are my point of views that how I can implement that module. So I need your suggestions? Is this the right way to achieve this goal or should I follow the other path? and which libraries are required to achieve this task or any tutorial similar to this problem ?
Thanks in Advance
I would suggest considering a third option: since the Word document files exist on the server, the cleanest place to pre-populate a form would be by extracting data from the document while it is on the server and filling in the form's fields before sending it down to the user in a codebehind. Trying to extract data on the client side from a recently-downloaded file via an application other than the browser seems ripe for kludgy-ness. Articles such as http://support.microsoft.com/kb/257757 should help get you started in the right direction.
For extracting data from ms word document using free .net word component and fill data to webform,
extract data,
Document doc = new Document();
doc.LoadFromFile("YouDocOrDocx.Docx");
string content = doc.GetText();
I am trying to open a MS word doc (.docx) file from my server. The file is saved from a previous form and the path of that file is saved in the database (SQL Server 2008 R2).
What I have currently set up is a search that returns a list of "filenames" back to the view. Right now it is a #Html.DisplayFor(r=>r.filename).
Is there a way to turn that DisplayFor into a link that opens in some word processor?
I don't want to download the file. I want it to work similar to Sharepoint where you can open the file without having to download a copy.
Setting the MIME type correctly will improve that experience in some browser versions, but it's not really a consistent solution, because eg. Chrome will still ask to save the file. Setting the MIME type can e done by setting Response.ContentType.
If your application runs in a local network, and the file is available over shared folders, you can use file:// url. In that case, you can get closer to your answer, asking for a Html Helper. You can write your own Display Template, for a custom type (eg. NetworkFile).
As for how Sharepoint fixes this, I'm not sure. Maybe there's some Office tooling you can hook into, but that's just a wild guess.
Available MIME types for Office 2007
Response.ContentType on MSDN