http - How to upload file using vba with Access 2010 -
i trying use vba/xmlhttp in access 2010 database upload file. while going through process , i'm not receiving errors, nothing ends on web site.
here's code called using:
response = http_fileupload(showname, "www.website_name","post")
public function http_fileupload(filename string, byval purl string, _ optional byval pmethod string = "get") string dim strresponse string on error goto errorhandler dim xmlstream object set xmlstream = createobject("adodb.stream") xmlstream.mode = 3 ' //read write xmlstream.type = adtypebinary xmlstream.open xmlstream.loadfromfile filename dim objhttp object set objhttp = createobject("msxml2.xmlhttp") objhttp.open pmethod, purl, false debug.print "file name " & filename & " size of file " & xmlstream.size objhttp.setrequestheader "content-type", "text/generic" objhttp.setrequestheader "content-length", xmlstream.size objhttp.send strresponse = objhttp.responsetext http_fileupload = strresponse set objhttp = nothing exit function errorhandler: msgbox "error - code " & err.number & " - " & err.description end function
Comments
Post a Comment