Web Forms :: Retrieving Displaying Word 2010 Documents From SQL 05 In Varbinary (MAX)
Mar 21, 2012
I am retrieving a word 2010 document that has been uploaded to a sql 2005 database. When I subsequently download and open the document in a word window it states the file is corrupted and gives the user the option of repairing the file for display. This always works fine but the corrupted message is always presented for all DOCX files. The DOC files from an older Word version work fine without incident. the section of code, VB.NET, for streaming the document out to display in Word is:
Dim bytes() AsByte = CType(dt.Rows(0).Item(2), Byte
())
Response.Buffer = True
Response.Charset =
""Response.Cache.SetCacheability(
[Code] ....
Where the content type value, in this case, is "application/vnd.openxmlformats-officedocument.wordprocessingml.document" (rather than "application/vnd.ms-word").
The filename is simply the full name of the document and the data itself is loaded into the Bytes var. I got some time back... it just doesn't like the new and improved word 2010 files.
View 1 Replies
Similar Messages:
Jul 22, 2010
I am loading documents into our Oracle database and then retrieving them for the users to view. So far PDF, DOC, XLS, CSV, etc. all perform as expected, however; DOCX, XLSX, etc. files have one annoyingly persistent issue. When the document is downloaded by the user and they open it you get the first in a series of messages: The file 'thefile.docx' cannot be opened because there are problems with the contents. Details: The file is corrupt and cannot be opened. and then: Word found unreadable content in 'thefile.docx'. Do you want to recover the contents of this document? If you trust the source, click Yes. After clicking yes the file opens and all of the content appears correct. Including images, formatting, tracked changeds and comments, equations, etc. I have tried multiple methods along these lines to no avail. I simply want the files to open without the false-positive error messages. I am using VS2010, with the website targeted at .Net Framework 2.0.
objConn =
New
OracleConnection(gstrConnectionString)
objConn.Open()
cmd = New
OracleCommand
cmd.Connection = objConn
cmd.CommandText = "select DOCUMENT_NAME,DOCUMENT_TYPE,DOCUMENT
from DOCUMENT_TABLE where DOCUMENT_ID='"
& strDocumentID & "'"
dr = cmd.ExecuteReader
dr.Read()
View 5 Replies
Jul 23, 2010
I am loading documents into our Oracle database and then retrieving them for the users to view. So far PDF, DOC, XLS, CSV, etc. all perform as expected, however; DOCX, XLSX, etc. files have one annoyingly persistent issue.
When the document is downloaded by the user and they open it you get the first in a series of messages:
The file 'thefile.docx' cannot be opened because there are problems with the contents.
Details: The file is corrupt and cannot be opened.
and then:
Word found unreadable content in 'thefile.docx'. Do you want to recover the contents of this document? If you trust the source, click Yes.
After clicking yes the file opens and all of the content appears correct. Including images, formatting, tracked changeds and comments, equations, etc.
I have tried multiple methods along these lines to no avail. I simply want the files to open without the false-positive error messages.
I am using VS2010, with the website targeted at .Net Framework 2.0.
objConn =
New
OracleConnection(gstrConnectionString)
objConn.Open()
[Code]....
View 15 Replies
Feb 3, 2010
I'm hoping this is an easy one...I'm using Microsoft.Office.Interop.Word to convert uploaded word documents into previewable html files. I haven't implemented it fully, but I've played around with it enough that I think I have a plan that will work... My question revolves around
[Code]....
I'm not in love with the idea of opening word and closing it everytime there's an upload (which I hope is a lot of the time) I'd like to make this a shared object that loads at application start. I have 2 questions
that go along with this. 1. I imagine that winword could lock up and that would be a problem, right? 2. to save a document I use wordapp.ActiveDocument, this could have an issue as a shared object, right? I think I'm talking myself right out of this...
View 1 Replies
Jan 25, 2011
I have a problem which I have not been able to find an answer to in months. I store word doc resumes as varbinary(max). I can retrieve the resumes based on a full-text search - no problem. But the resumes are retrieved as word documents in a .ashx file with the following code. I really need to implement hit highlighting on the site so that users can see if the returned resume is a good fit or not. I don't think this can be done from an .ashx file, so I think I need to be able to open the resume as html in an aspx page and maybe use javascript to do the hit highlighting or perhaps return the text only content of the word document somehow and manipulate the text before display with html tags. I cant find anything anywhere which addresses the problem.
[code]....
View 1 Replies
Mar 8, 2010
I would like to know is there any way to read word documents with out using COM components from ASP.NET application.
View 1 Replies
Jan 4, 2013
<a href="untitled.GIF">untitled</a>
<a href="aaa.txt">aaa</a>
<a href="DaryaSoft_FaxList_pdf.pdf">pdf</a>
<a href="4663750304151.swf">swf</a>
when I click on gif and txt file links I can see Image and content of txt file in page and their address in address bar but by clicking on swf and png files link download dialog box appear? I need to remove this type of files from htaccess and I searched and found the Equivalent of htaccess is authorization section of web.config but I don't know..I need when click link I can see file and it's address in address bar.
View 1 Replies
Nov 25, 2011
I want to know how to upload Word, PDF and Excel documents to SQL Server database in ASP.Net
View 1 Replies
Feb 13, 2010
i want to store a word documents (.doc) in the database and i need to provide search over a collection of Word documents and highlight the words too.
I m using VS2005 --> ASP.NET, C#.NET, SQL Server.
View 3 Replies
Mar 26, 2010
I'm looking for a way to export a Word document as a PDF. I would like to do this without the use of a "software printer" (such as CutePDF, etc.) and stick to reference assemblies if at all possible. I'm using Microsoft Office Interop Assemblies to generate a Word Document which I save to a temporary directory. So its not necessary for this solution to interact directly with Microsoft Office, unless it needs to.
View 1 Replies
Mar 16, 2011
One of my sites is on HTTPS and includes a document repository which has a lot of Office documents (.doc, .docx, xls, etc...)
We recently found that these may not be downloaded using IE8. Further research led me to this article.
[URL]
The resolution states to "remove the no-cache header" which is required by design. I found the following article describing how to do so:
how do i remove the security risk, due to cached version of page.
Unfortunately, the methods explained have not worked.
View 1 Replies
Sep 28, 2010
I have a need for users to be able to edit word documents from my web page.
Are there any editors, or components, that will allow me to do this?
A bit of background, the user will be able to upload a word document to my site and then view/edit it from there. There will be no requirement for the user to download the document again but ideally I'd like to keep the document as a word doc at my end.
View 2 Replies
Jan 30, 2010
How to read doc, docx file into .NET with C#.
View 5 Replies
Mar 25, 2010
I'm having some difficulty merging multiple word documents together using Microsoft Office Interop Assemblies (Office 2007) and ASP.NET 3.5. I'm able to merge the documents, but some of my formatting is missing (namely the fonts and images). My current merge code is shown below.
private void CombineDocuments() {
object wdPageBreak = 7;
object wdStory = 6;
object oMissing = System.Reflection.Missing.Value;
object oFalse = false;
object oTrue = true;
string fileDirectory = @"C:documents";
Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document wDoc = WordApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
string[] wordFiles = Directory.GetFiles(fileDirectory, "*.doc");
for (int i = 0; i < wordFiles.Length; i++) {
string file = wordFiles[i];
wDoc.Application.Selection.Range.InsertFile(file, ref oMissing, ref oMissing, ref oMissing, ref oFalse);
wDoc.Application.Selection.Range.InsertBreak(ref wdPageBreak);
wDoc.Application.Selection.EndKey(ref wdStory, ref oMissing);
}
string combineDocName = Path.Combine(fileDirectory, "Merged Document.doc");
if (File.Exists(combineDocName))
File.Delete(combineDocName);
object combineDocNameObj = combineDocName;
wDoc.SaveAs(ref combineDocNameObj, ref m_WordDocumentType, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
}
I don't care necessarily how this is accomplished. It could output via PDF if it had to. I just want the formatting to carry over.
View 1 Replies
May 7, 2015
how work Microsoft word editor in asp.net?
View 1 Replies
Jan 31, 2011
What i need to do is to retrieve only one page of word document at a time and provide user with next and previous buttons to move to forward and backwards to view other pages of document, just like pagging in gird view of other controls.
View 2 Replies
Feb 2, 2010
I have a webpage called DisplayBinaryData.aspx - the purpose of this page being to display/download any word, excel, pdf or images. I call this webpage and pass the id of my BinaryData entity using a querystring. The BinaryData entity contains the file, filename and contenttype uploaded using the asp.net fileUploadControl. The code in the page load is below:
BinaryData obj = GetBinaryObjectById(int.Parse(Request.QueryString["id"]));
Response.Clear();
Response.BufferOutput = true;
Response.AddHeader("Content-Disposition", "attachment; filename=" + obj.FileName);
Response.ContentType = obj.FileContentType;
Response.BinaryWrite(obj.BinaryFile);
Response.Flush();
Response.Close();
Response.End();
This code executes perfect in IE,but fails when executed in FireFox. IE prompts the user, either to save or open the content. FireFox also prompts the user, but the dialog box fails to save or open any content. When executing this in google chrome - there is no dialog box, it starts downloading the content automatically.
View 1 Replies
Oct 9, 2012
Using data posted by a mobile app to my database (via a web api) I will need to create PDF forms with the data filled in as if a user did that. I never did PDF generation, so some "points" that might decide what to use:
-Forms are pretty much a tabular structure.
-Some pages are in portrait, while others in landscape.
-Some columns have the data printed vertically.
-I will need to put images (saved in database, byte arrays) in some fields.
From what I read so far ITextSharp seems to be a popular choice?
View 3 Replies
Jan 28, 2011
I want to produce a relatively simple webpage which would contain a drop-down list and a button. When the user makes a selection on the drop-down list and clicks the button (or image), the page would query a SQL database and output the results of that query to an iFrame that would be embedded in the lower half of the page. I've managed to figure out the necessary code for populating the drop-down list by using a stored procedure, and I've managed to figure out a way of having the resultset displayed on a second page but I want to now finesse it and get all of the information displayed on a single page.
View 1 Replies
Nov 26, 2010
Issue with my application is I am able to save word document but not able to see online. I am using .Net Framework 4.0, MS Office Word 2003.
Here is the code:
1) test.aspx
<%@ Page Language="VB" %>
<%@ Import Namespace = "Microsoft.Office.Core"%>
<%@ Import Namespace = "System.Runtime.InteropServices"%>
[Code].....
When I click form button, it does saves the document but not shows to the client.
View 13 Replies
Apr 5, 2011
Anyone know how to use the file upload control to upload word docs etc
View 3 Replies
Jan 28, 2011
in my db i have:
2011-01-28 12:03:46.223
when displaying on .aspx page,
<%# Eval("ModifiedDateTime") == null ? " " : Eval("ModifiedDateTime")%>
it displays on the grid like this:
12/2/2010 8:43:18 AM
how do I format it like the default format shown when I query my db?
View 1 Replies
Apr 28, 2010
I want to create a page that will dynamically change the images displayed, based on which link the user clicked to get there. For example I have different movies listed and when you click a link for one of them it displays all the images for that movie. I need it to be on one page because at the moment I have hundreds of pages and its very hard to manage. I have the images stored in BLOBS on SQL Server 2005. I can retrieve all the images for a certain category and store the Image data for each one into a list of images. What I cant do, is display the images on the page. I can display one image by using the queryString to get the image by ID, then putting the Eval code into an asp:image, but I dont know how to do it for multiple images.
View 7 Replies
Oct 25, 2010
ive have a call that pulls back an RSS feed and displays it in a label but theres stuff i dont want after the word "Fast" how do i go about parsing a label field to stop displaying anything after the word "fast".... if that makes sense
P.S! this isnt my first post had to create a new account. microsoft! when you click forgot password it brings up an error...and the few times it works the link it sends you is expired when you click on it..been like that for 2 weeks!
View 9 Replies
Jan 21, 2010
Having trouble with a web page and connecting to SQL DB. Basically I have a form view table connected up to a SQLDataSourceControl and what I want displayed in the form is only data that has been assigned to the user that is logged on now. I have a "ViewAll" page, which lists EVERY field, regardless of who it is assigned to, but the "MyTasks" page should only retrieve the data of the current user.
I have two tables in my DB, the "Users" table, with user data (including an ID number) - this is used again in the "Tasks" table as a foreign key called "AssignTo". Therefore if user Joe Bloggs with ID number 5 logs on, whenever someone assigns a task to him, they will select number 5 in the "Task" table, as this relates to his User ID.
View 10 Replies