Click here to Skip to main content
15,566,678 members
Home / Discussions / C#
   

C#

 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 3:59
mvaOriginalGriff27-Jul-20 3:59 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:18
ago248627-Jul-20 4:18 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 4:37
mvaOriginalGriff27-Jul-20 4:37 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 5:08
ago248627-Jul-20 5:08 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 5:38
mvaOriginalGriff27-Jul-20 5:38 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 5:45
ago248627-Jul-20 5:45 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 5:53
ago248627-Jul-20 5:53 
Questionsaving a Word Doc from address bar in .net/C# Pin
Pita3225-Jul-20 6:50
Pita3225-Jul-20 6:50 
I've got a situation in my .Net application where I have a popup modal where the user will select a Word document and my process will save it to a repository under a different standardized name.

To get the input file from the address bar:

HttpPostedFileBase fileContent = Request.Files[0];


Then the save:

fileContent.SaveAs(fullPath);


Unfortunately the SaveAs does not work, as when you get the Word Document from the Response object, it blanks it out when doing the SaveAs.

So what I need to do is get the Word Document that the user selected, and save the contents of that Word Document to a Word Document with a different, standardized name.

so what I have so far is

using (var documentReader = new StreamReader(fileContent.InputStream))
{
     var readDoc = documentReader.ReadToEnd();
}


I know my readDoc variable contains the selected Word document contents, and it appears to do the ReadToEnd correctly, the problem now is, I need to be able to save those contents stored in readDoc to a different Word Document with a different name.

Any ideas on how to go about this?
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 8:19
mveGerry Schmitz25-Jul-20 8:19 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 10:22
professionalDerekT-P25-Jul-20 10:22 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 10:58
mveGerry Schmitz25-Jul-20 10:58 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 12:38
professionalDerekT-P25-Jul-20 12:38 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan25-Jul-20 22:59
mveRichard MacCutchan25-Jul-20 22:59 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Pita3226-Jul-20 7:37
Pita3226-Jul-20 7:37 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan26-Jul-20 7:46
mveRichard MacCutchan26-Jul-20 7:46 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard Deeming27-Jul-20 0:50
mveRichard Deeming27-Jul-20 0:50 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan27-Jul-20 1:03
mveRichard MacCutchan27-Jul-20 1:03 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Richard Deeming27-Jul-20 0:51
mveRichard Deeming27-Jul-20 0:51 
QuestionGet List Of SQL Foreign Keys Using C# Pin
Kevin Marois24-Jul-20 7:46
professionalKevin Marois24-Jul-20 7:46 
AnswerRe: Get List Of SQL Foreign Keys Using C# Pin
Richard Deeming24-Jul-20 8:29
mveRichard Deeming24-Jul-20 8:29 
GeneralRe: Get List Of SQL Foreign Keys Using C# Pin
Kevin Marois24-Jul-20 8:42
professionalKevin Marois24-Jul-20 8:42 
GeneralRe: Get List Of SQL Foreign Keys Using C# Pin
Dave Kreskowiak24-Jul-20 8:49
mveDave Kreskowiak24-Jul-20 8:49 
GeneralRe: Get List Of SQL Foreign Keys Using C# Pin
Kevin Marois24-Jul-20 8:53
professionalKevin Marois24-Jul-20 8:53 
GeneralRe: Get List Of SQL Foreign Keys Using C# Pin
Kevin Marois24-Jul-20 8:53
professionalKevin Marois24-Jul-20 8:53 
GeneralRe: Get List Of SQL Foreign Keys Using C# Pin
OriginalGriff24-Jul-20 8:50
mvaOriginalGriff24-Jul-20 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.