api - Using VBA to convert file to application/octet-stream -


i using excel generate quote , vba script upload quote , pdf version our job management software using xmlhttp.

i have xmlhttp part working when send file, upload successful (get success message , file on server) file turns corrupt.

i meant send file 'application/octet-stream' methods have attempted expect uploading .txt files has corrupted.

the code using follows:

dim filename string filename = "c:\users\rob\desktop\test365.pdf" dim filecontents() byte, filenumber integer redim filecontents(filelen(filename) - 1) filenumber = freefile open filename binary filenumber     filenumber, , filecontents close filenumber dim filecode() string redim filecode(filelen(filename) - 1)  x = 0 (filelen(filename) - 1)     filecode(x) = bytetobit(filecontents(x))     msgbox (strconv(filecode(x), 256)) next  dim pleasework string pleasework = join(filecode, "")    

however when post pleasework, doesn't work! know doing wrong?

is going give me octet-stream?


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -