Questions tagged [filestream]

1

votes
1

answer
30

Views

How to close a stream created with GdipCreateStreamOnFile

The GDI+ flat interface (gdiplusflat.h) declares a function GdipCreateStreamOnFile How is that stream supposed to be closed?
user1274247
1

votes
1

answer
410

Views

Compressed content in a byte array to uncompressed in a string

How can we create a simple function to take the compressed content from an array of byte (compressed with Deflate method, ANSI encoded) and express it in a string? I go with this one : public string UnzipString3(byte[] byteArrayCompressedContent) { int compressedSize = byteArrayCompressedContent.Le...
Gaël
1

votes
0

answer
725

Views

FileStream was asked to open a device that was not a file

I'm monitoring an FTP folder for orders which I then read into string array for further processing before deleting the file. On the whole is works but occasionally I get the following exception: FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:...
MarkBrad
1

votes
1

answer
205

Views

Create PDF from existing pdf with azure storage

I made a bot application with the Microsoft Botbuilder. Now I want to create a pdf-file from the user input. The file should be stored in my azure storage. I have a 'pdf-template' which should be copied and modified (this file is in the azure storage already). It has some textboxes which should be f...
Detlef D Soost
1

votes
2

answer
38

Views

Getting Special character while creating a file

I am writing text to a file but getting special character appended at the beginning. Can anyone please guide why it is happening and how can we avoid it. using (FileStream fs = new FileStream(FILE_NAME, FileMode.CreateNew)) { using (BinaryWriter w = new BinaryWriter(fs)) { w.Write(@' COMMENT: OnDema...
Anirudh Agarwal
1

votes
2

answer
2.2k

Views

System.IO.FileNotFoundException : Could not find file

I am using file upload control. But when I try to read uploaded file, it's looking for folder where project is created and giving error. The code for this Upload File and [HttpPost] public IActionResult UploadFile(IFormFile file) { string FileName = file.FileName; if (file != null && file.Length !=...
swapnil
1

votes
0

answer
49

Views

How do you copy a SQL Server filetable directory and its contents recursively to another directory?

I have a SQL Server 2014 FileTable, which contains directories and files. I have been tasked with writing a stored procedure that will copy a directory and all its contents recursively from one location to another within the FileTable. However, this is for an ASP.NET web application, so if the sto...
RebelScum
1

votes
0

answer
276

Views

.Net Core 206 partial content error on mobile network

I have a client that streams videos from the client-backend and an api. On the Client-backend, the video stream fails over mobile network sometimes, this never occurs with the api. (.net core v2.0) Here is my file stream on the client back-end (now replaced with v2.1): [HttpGet('ConvertedVideo/{path...
Anton Toshik
1

votes
1

answer
742

Views

Filestream a blob from Azure storage

I have images in Azure that I need to add in a pdf using pdfJet. This is the code that I use if I read an image on disk, however I have a lot of images and it does not make sense to download them from Azure. Image image = new Image(objects, new BufferedStream(new FileStream(LocalPath + 'image.PNG',...
Anne
1

votes
1

answer
66

Views

Use Flush(True) and FlushFileBuffers both?

I want to write to a file and flush to disk immediately. Other questions on SO pointed out that Flush(True) isn't reliable on .NET 4.0. I am indeed using .NET 4.0 and can't upgrade any time soon. Is FlushFileBuffers reliable? or is it known to have a bug too? Is there an option that I can use or sh...
user1071840
1

votes
0

answer
10

Views

I get a file in use error. If I double click on the ISO file from explorer it does open

Hi folks I am new to C# using the following code I get a file in use error. If I double click on the ISO file from explorer it does open. Not sure what I am missing here if I can manually open the ISO why does my code not open it? code: private void btnOpenISO_Click(object sender, EventArgs e) { lis...
user2180706
1

votes
0

answer
34

Views

Need to write numeric values in DBF File using ExcelReaderFactory

The code below is tested and writes a dbf file but the values are strings because i cannot seem to initialize or convert the values to doubles or floats before writing to the file. Can anyone assist and see how for example the first variable(bsi_code) can be written as a double or float? Is it okay...
ivias
1

votes
1

answer
33

Views

Copy files with a chunked stream causes the files to be different sizes due to last read

Could someone be kind enough to explain how I get my files the same size after copying it using a chunked stream? I presume it is because the last chunk still has a buffer size of 2048 so it is putting empty bytes at the end, but I am unsure how I would adjust the last read? Original size: 15.1 MB (...
Ben
1

votes
0

answer
29

Views

How do I preview a file using InputStream in WebView iOS- swift

I am working on file previewing in iOS. I have tried using UIWebview to load the data and UIDocumentInteractionViewController. However, these methods won't work well with large files. I was thinking of using FileStreams InputStream/OutputStream to preview files. How can I use UIWebview to preview fi...
user3624761
1

votes
1

answer
397

Views

SQL Server 2008 Filestream Error

On my local Windows XP machine, I'm not able any more to create databases with FILESTREAM. alt text http://img379.imageshack.us/img379/9899/errorv.jpg This error is caused by one of these security updates from MS: KB952004 KB923561 KB961373 KB956572 KB959426 KB960863 Does anybody know how to res...
1

votes
4

answer
650

Views

Really strange problem with just in time debugging and filestreams

I developed a small program which was working fine until I made a really minor change in some unrelated part of the code. From that point onwards the program throws an unhandled win32 exception and Microsoft Visual Studio Just in time debugger kicks in. I am using codeblocks and my compiler is the g...
Lefteris
1

votes
2

answer
1.1k

Views

Problem with storing large files in database

I have used linq to sql to store files in a varbinary(max) field. Filestream is activated too, but when I try to store files with 400 or 500 MB I get this error: Exception of type 'System.OutOfMemoryException' was thrown My Code is: Dim ByteArray() As Byte = File.ReadAllBytes(OpenFileDialog1.Fil...
Hosein Mohtasham
1

votes
5

answer
1.3k

Views

How do I load text files into database that are greater than the 64 kb buffersize limit?

I'm trying to load text files (.aspx, .cs, html, etc) into a sql server 2008 database. I'm able to load all files that are less than 64 kb so far. I have two questions; How do I get around the 64 kb limit, and is the method I'm using the best way to do this? Thanks for the help. Database: file_lengt...
Michael
1

votes
2

answer
228

Views

Two CryptoStreams associated with one file in C#

I would like to create a file 'myFile' that encrypts the first part using a certain key, and the last part using a certain key. So far I have something like this: cs1 = new CryptoStream(myFile, symmetricKey1.CreateEncryptor(key1, key1IV), CryptoStreamMode.Write); cs2 = new CryptoStream(myFile, symm...
Leboff
1

votes
1

answer
592

Views

FILESTREAM access via streaming API

On a web server, we plan to pull back a file stored in SQL in a FILESTREAM using the Win32 streaming API. Are there any special ports that must be opened to make this work? Or will the standard 1433 suffice?
John Livermore
1

votes
2

answer
2k

Views

ACCESS DENIED error from stream file open

I have create my code in order to write images in a remote sql server All the details of accessing and writing are fine until now, including the system account right now i'm in the command of: SqlFileStream = New SqlFileStream(filePathName, fileToken, FileAccess.Write) and when i'm trying to execute...
Lefteris Gkinis
1

votes
1

answer
1.1k

Views

Deserializing a FileStream on Client using WCF

I'm very new to WCF, so I apologize in advance if I misstate something. This is using .NET 4.0 RC1. Using WCF, I am trying to deserialize a response from the server. The base response has a Stream as its only MessageBodyMember. public abstract class StreamedResponse { [MessageBodyMember] public Str...
Nathan
1

votes
2

answer
1.7k

Views

how to read the txt file from the database(line by line)

i have stored the txt file to sql server database . i need to read the txt file line by line to get the content in it. my code : DataTable dtDeleteFolderFile = new DataTable(); dtDeleteFolderFile = objutility.GetData('GetTxtFileonFileName', new object[] { ddlSelectFile.SelectedItem.Text }).Tables[0]...
Innova
1

votes
1

answer
946

Views

Any succesful document management sytem (application using documents intensively) using sql server filestream?

Did anyone create a Document Management System using SQL SERVER's Filestream? By this I mean: if an application makes intensive use of documents is filestream a good option, or in those cases it would be better to go for another solution? I understand this depends on many factors, but in general my...
LaBracca
1

votes
1

answer
186

Views

Sensible use of SQL Server 2008 FileStream?

I have an ASP.NET MVC application and I want to embed on each page some help content. This will be HTML pages that will be loaded into a dialog or new browser page (to be decided). Obviously I could store this in a max text field in the DB, but I also think I could store it in a FileStream. This sou...
Colin Desmond
1

votes
1

answer
3k

Views

how to set a network path for filestream filegroup

How to configure a database so that filestream data is stored on a non local path? To enable filestream at db level I do first: ALTER DATABASE MyDatabase ADD FILEGROUP FileStreamFileGroup CONTAINS FILESTREAM; GO Then: ALTER DATABASE MyDatabase ADD FILE ( NAME = MyDatabaseFileStreamFile, FILENAME = '...
LaBracca
1

votes
2

answer
340

Views

Can a FileStream be promoted from Read-Only to Read-Write?

Is there a way to promoting a Read-Only FileStream to Read-Write? I am looking for functionality similar to the Win32 SDK function ReOpenFile.
David B
1

votes
5

answer
7.9k

Views

System.IO.FileInfo throwing access is denied exception to a local file

I created a sample Silverlight Web project and I am getting 'Access is denied' when I do this: string fileName = 'map.gif'; FileInfo fileInfo = new FileInfo(fileName); How can I give the web project access to this folder/file? I added the image into my project, really drawing a blank here....
VoodooChild
1

votes
1

answer
2.7k

Views

monitoring a file for changes

I'm trying to achieve tail-like functionality in my Visual Studio 2008 C++ application. (i.e. show in real-time the changes to a file not owned by my process.) /// name of the file to tail std::string file_name_; /// position of the last-known end of the file std::ios::streampos file_end_; // start...
PaulH
1

votes
1

answer
2.7k

Views

Entity framework 4 and sql filestream to read a file from db

I'm using ASP.NET 4, EF 4 and FILESTREAM in SQL 2008 to add/read files to the DB. I'm able to upload files just fine, but I'm not able to retrieve the files the way I want to. Here's what I'm doing - I have a grid which displays a list of files. Each line item is a file with a CommandName and Comman...
tempid
1

votes
3

answer
483

Views

Which problems can be there in using win32 applications that handle office 2010 64 bit files?

I am testing one application that handles files (stored in sql server using filestream). It is a Delphi win32 application. Opening a xls document stored in the db (originally saved with Office 2003) gives an error from Excel 2010 64bit. Is there some known compatibility issues with Office 2010 64bi...
LaBracca
1

votes
1

answer
433

Views

Reading a file from a UNC path and setting the correct MIME type in a HTTP request

How would I go about reading a file from a UNC path, discovering the proper MIME type, and streaming that out to a browser? It feels to me like I'm re-inventing IIS, and I'll also have to maintain my own MIME type database for each file extension. Does the above request sound reasonable, or is ther...
random65537
1

votes
2

answer
2.8k

Views

opening url based file in filestream

I have a document which is stored in doc library of sharepoint..now i want to open and read data from it ...how can i do it ..filestream does not take url as input ..please help.
user505210
1

votes
4

answer
222

Views

not able to save the text file data in c#

it seems to be a rare Issue where i am not able to save the text file data strpath='c:\path\1234\abcd.txt'; here file is getting cretaed but the data which is there in the file is not getting saved . if i check by Byte b length is shows 121. public int SaveFile(byte[] b,strin...
happysmile
1

votes
1

answer
56

Views

How do I not send the browser all the file data during the save prompt?

I'm checking the connection_status() in my shutdown script to detect if the file I'm serving through php was downloaded or interrupted. However since the browser downloads the file during the save prompt, and it's a very small file (1mb), it's very easy to end up getting false positives where the fi...
Kit Sunde
1

votes
1

answer
898

Views

Ajax to stream file with a MINE of EXE or ZIP or XSL etc

right now we are using href to link to downloadfile.asp with the parameters so we have a browser window opens. is it possible with jquery/ajax?
Y.G.J
1

votes
1

answer
1.6k

Views

SharePoint Foundation 2010 RBS FILESTREAM migration

We have a SharePoint Foundation 2010 installation with a large content database ( ~30 GB ) and we have configured the SQL Server (2008 R2) and the SharePoint to use FILESTREAM RBS. My understanding of FILESTREAM RBS is that it should store the BLOBs on disk separately from the mdf file. Indeed I hav...
axk
1

votes
1

answer
362

Views

Android tries to download database-created image files

I have a script that pulls an image from SQL Server and displays it as a link or on a page. Works perfectly in a browser and on most mobile devices. However, when linking directly to the aspx file link Android phones download the content but don't recognize the extension as an image, so they just...
Brad
1

votes
2

answer
1.1k

Views

Saving unicode characters as ““” into a file; C#

I have an xml file (converted from xfdl) which contains something like: I load it and save it using... XmlDocument xmlOut = new XmlDocument(); //note: not read only FileStream outfs = new FileStream(tempOutXmlFileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); xmlOut.Load(outfs); xmlOut....
emragins
1

votes
1

answer
870

Views

From URLLoader to FileStream (or vice versa)

I have a functionality working with a file hardcoded through URL Loader, but I want to be able to select the file from anywhere on my harddrive in an Air application. public function loadFile(): Array { csv = new URLLoader(); csv.addEventListener(Event.COMPLETE, completeHandler); csv.load(new URLReq...
Damon

View additional questions