Forums » Development »
How can i upload a file from my local machine to an issue
Added by Antonio Di Tullio almost 8 years ago
Hi,
Help me
How can i upload a file from my local machine to an issue in redmine??
language: ASP, VBA
When i upload a file with the code below, the application create a file with a text.
RequestURL1 = "http://link/issues/77621.xml?key=590fe11527aa9e185539050a5d0d3c72aa8c6d6d"
Set xhr = CreateObject("MSXML2.XMLHTTP.6.0")
xhr.Open "PUT", RequestURL1, False
xhr.SetRequestHeader "Content-Type", "text/xml"
RequestBody = "<?xml version=" & Chr(34) & "1.0" & Chr(34) & "?>"
RequestBody = RequestBody & "<issue>"
RequestBody = RequestBody & "<id>" & "77621" & "</id>"
RequestBody = RequestBody & "<uploads type='array'>"
RequestBody = RequestBody & "<upload>"
RequestBody = RequestBody & "<token>"& token.text &"</token>"
RequestBody = RequestBody & "<filename>teste.txt</filename>"
RequestBody = RequestBody & "<description>Teste Anexo</description>"
RequestBody = RequestBody & "<content_type>application/txt</content_type>"
RequestBody = RequestBody & "</upload>"
RequestBody = RequestBody & "</uploads>"
RequestBody = RequestBody & "</issue>"