C - Reading a file into a byte array


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I'm trying to read a file into a byte array in C. I have to use C as this is for a loadrunner script which is based on the C programming language
The .Net code from the developers I'm basically trying to simulate in C is below. I'm not a C programmer but have done some basic C programming as required in my loadrunner scripts so this is a bit out of my depth. Any help would be very appraciated
Did you know?Explore Trending and Topic pages for more stories like this.

Thanks

/// Loads the file to the upload request.

///

/// The upload document request.

/// Name of the file.

///

private void LoadFileToUploadRequest(UploadDocumentRequest uploadDocumentRequest, String fileName)

{

if (File.Exists(fileName))

{

FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);

BinaryReader br = new BinaryReader(fs);



uploadDocumentRequest.Data = br.ReadBytes((int)fs.Length);

}

}
No comments posted yet

Your Answer:

Login to answer
334 Like 10 Dislike
Previous forums Next forums
Other forums

image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

Help With editting and deleting form
So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.png
This table

To add a field on the screen XK02.
Hi All,

How to add an additional field in the vendor change control screen XK02.
The

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs each
I

How to show a complete textarea ??
I enter Client Case Notes notes in a textarea field on a PHP form. The field is 5 rows deep and 70 c

php sessions,logouts & the bloomin back button!
Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed,

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash