Monday, August 29, 2022

Read the data from the file and insert it into DB

 Read the data from the file and insert it into DB

#ifndef _GLOBALS_H

#define _GLOBALS_H

//--------------------------------------------------------------------

// Include Files

#include "lrun.h"

#include "web_api.h"

#include "lrw_custom_body.h"

//--------------------------------------------------------------------

// Global Variables

#endif // _GLOBALS_H

=====

vuser_init()

{

char *raw_data = 0;

unsigned long raw_data_len = 0;

int res;

unsigned int log_options = lr_get_debug_message();


lr_set_debug_message(log_options, LR_SWITCH_OFF);

res = lr_read_file("sample.pdf", "Bin_Document_Data", 0);

lr_eval_string_ext("{Bin_Document_Data}", 19, &raw_data, &raw_data_len, 0, 0, -1);

lr_message("res = %d\n raw_data_len = %d\nraw_data = %s", res, raw_data_len, raw_data);

lr_get_debug_message(log_options, LR_SWITCH_ON);


return 0;

}

=======

Action()

{

unsigned int log_options = lr_get_debug_message();

lr_set_debug_message(log_options, LR_SWITCH_OFF);


web_custom_request("",

"URL = ",

"Method = POST",

"Resource = 0",

"RecContentType = multipart/mixed",

"Referer = ",

"Snapshot = t1.inf",

"Mode = HTML",

"EncType = multipart/mixed; boundary=\"batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e\"",

"BodyBinary = --batch_357647d1-a6b5-4e6a-aa73-edfc88d8866e\r\n...........Content-Type:application/octet-stream\r\n\r\r{Bin_Document_Data}\r\n\r\n\r\n\r\n--.............; ",

LAST);

lr_get_debug_message(log_options, LR_SWITCH_ON);

 return 0;

}

No comments:

Post a Comment

Thread

Native Thread Demon Thread Non-Demon Thread Native Thread: - Any Method/Thread which is mapped to OS is called Native Thread or Method. Demo...