Questions tagged [filestream]

In .NET framework filestream exposes a Stream around a file, supporting both synchronous and asynchronous read and write operations. ActionScript 3 for AIR 2 and above also uses FileStream, which supports both synchronous and asynchronous read and write operations.

2638 questions
0
votes
1 answer

How to save a file to disk from RestSharp through Swagger

This question is wee bit similiar to this one and I have used most of the accepted solution including the suggested ResponseTypeFilter. Specifically my Swagger controller looks like this: [SwaggerFileResponse(HttpStatusCode.OK, "File…
dansolhe
  • 33
  • 2
0
votes
1 answer

How to read and write .img files using FileStream in c#?

I am trying to read an image file and write it into a new file. But the written image file is not a supported file. please tell me about what is the proper way to read/write image files. Help me!! Here is my full code. And I did not get any…
user12260778
0
votes
2 answers

iis7 website accessed externally downloads files to server instead of local machine

I've a site set up in IIS. It's allows users to download files from a remote cloud to their own local desktop. HOWEVER, the context seems to be mixed up, because when I access the website externally via the IP, and execute the download, it saves the…
user756678
  • 13
  • 6
0
votes
2 answers

How to set FileType on filestream

I'm trying to send a file stream from c# to my js backend. The name and path get send over correctly but the type seems to be missing when I log the file that enters my backend and I absolutely need the filetype but I can't figure out how to pass it…
Mout Pessemier
  • 653
  • 1
  • 7
  • 23
0
votes
1 answer

Buffer files to send a filestream to a backend

I'm writing my first custom Activity for a UiPath RPA workflow in which I need to async send a filestream to the backend. This is what I've come up with but I just have this feeling that this doensn't quite work: class SendFiles :…
Mout Pessemier
  • 653
  • 1
  • 7
  • 23
0
votes
1 answer

Stream failing to close C#

I am creating a program which takes passwords and applies an encoding on them onto a file which I have creatively labeled a PASSWORDFILE file. I am a self taught amateur programmer and this is my first time using streams => I'm sorry my code isn't…
Elliot Hodge
  • 103
  • 4
0
votes
3 answers

How can I lock a file from within a Java application for all other processes on a operating system?

I have a file I need to read several times from. I have to open the InputStream to the same file in sequence. Now I wonder if that file can be locked for the whole os as long as a specific portion of the Java application is running? I want to…
xetra11
  • 4,474
  • 6
  • 39
  • 98
0
votes
1 answer

How can I save a video recorded using MediaRecorder to a file in Asp.NET Core?

By the way, please don't post links to other similar questions because I have seen them all and they don't help. I've been working on this for 7 hours. So, I'm trying to capture a video from a webcam (using MediaRecorder) and save it to a file (in…
0
votes
0 answers

How to dispose of temp screen rendering for bitmap.Save(Response.OutputStream, ImageFormat.Jpeg)?

It works draws text of a number and name on a raffle ticket and saves it in the customer's file correctly. But then returns me = not to the web page but a full black screen with the picture of the ticket. No way to make it go away and get back to…
All_IN
  • 1
  • 2
0
votes
1 answer

Need to write out grid 9x9 number text file to a new text file in the same format C++

This is the input file that my output file needs to be the same as this is the output I currently have (its getting closer) The first part of the problem that I have completed is to write a method that takes grid text file of 9x9 numbers into a 2d…
0
votes
1 answer

Read binary file from a position in ASP.NET

I want to read a binary file from a particular position. I am using the following code but that is not working. FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read); fs.Seek(len,SeekOrigin.Current); int bytesRead = fs.Read(buf,…
Ankit
  • 5,983
  • 7
  • 46
  • 74
0
votes
1 answer

Facing Error "Failed to load PDF document." in scala when send pdf file as bytearray in response (scala)

I write the below code for send pdf file as a response, but I stuck at one point it will give an error "Failed to load PDF document." Code is : def downloadResumeFile(downloadFilePath: String, response: HttpServletResponse): ResponseEntity[String]…
UNV
  • 33
  • 6
0
votes
1 answer

How to select all files of a SQL Server database from blob folder?

I have a SQL Server database. You can use the following script to create similar database: CREATE DATABASE [test] CONTAINMENT = NONE ON PRIMARY (NAME = N'test', FILENAME = N'C:\Program Files\Microsoft SQL…
isxaker
  • 6,265
  • 6
  • 48
  • 77
0
votes
0 answers

Reading in from txt file when format changes

I'm trying to create an Instruction Set Simulator that reads in assembly and executes the desired action. Each line consists of [address][instruction][input1] and possibly also [input2] The file I'm reading looks like this: 10 MOV R1, 1 11 MOV…
BCool
  • 3
  • 2
0
votes
0 answers

Write a file to the beginning of a specific sector of a hard drive

I am trying to write a file to a HDD but at a specific sector, I get have no data being wrote. Its about 1.5GB, Shouldnt I see activity right away? using (FileStream stream = new FileStream("/Resources/MyFileName.NoExt", FileMode.Open)) // Grab…
1 2 3
99
100