HelpSpot Help Desk Software | HelpSpot Blog | HelpSpot Support

Posting an attachment using private.request.update


I am having trouble getting a file (attachment) to post using private.request.update.

The following code works without error - and no error response from the server, but the file does not post.

All the other request fields are updated.

I set the option to allow file attachments for the portal, but still no luck.

It is - can anyone me what I need to do?


            Dim uri As New Uri("http://servername/helpspot/api/index.php?")
            Dim Data As String = ""
            Data = Data & "method=private.request.update"
            Data = Data & "&xRequest=12579"
            Data = Data & "&fNoteType=1"
            Dim tnote As String = "This is the note"
            Data = Data & "&tNote=" & System.Web.HttpUtility.UrlEncode(tnote)
            Data = Data & "&xCategory=15"
            Data = Data & "&Custom5=Evaluation"
            Data = Data & "&File1_sFileName=" & System.Web.HttpUtility.UrlEncode("aft_ck.clf")
            Data = Data & "&File1_sFileMimeType=" & System.Web.HttpUtility.UrlEncode("text/plain")
            Data = Data & "&File1_bFileBody="

            Dim fData() As Byte
            Dim fCode As String
            fData = System.IO.File.ReadAllBytes(My.Application.Info.DirectoryPath & "\DLLs\aft_ck.clf")
            fCode = Convert.ToBase64String(fData)

            Data = Data & fCode

            Dim request As HttpWebRequest = HttpWebRequest.Create(uri)
            request.Credentials = New NetworkCredential(username, pwd)
            request.Method = WebRequestMethods.Http.Post

            request.ContentLength = Data.ToString.Length
            request.ContentType = "application/x-www-form-urlencoded"
            Dim writer As New StreamWriter(request.GetRequestStream)

            Dim oResponse As HttpWebResponse
            oResponse = request.GetResponse()
            Dim reader As New StreamReader(oResponse.GetResponseStream())
            Dim tmp As String = reader.ReadToEnd()


Hi Roger,

Are you able to upload the file via the UI? Perhaps it’s too large?


Hi Ian,

Yes, I can post the same file via the Portal UI without a problem

I know you don’t have examples of this in VB.NET, but can you point me to another programming language that has an example of posting a file?

By the way, this is a great product. This is my only far.



Hey - I found the problem:

Everything was ok - except I had:


It should be:


Everything is working fine now - thanks for your help


I spoke too soon -

If I attach to a public note, the note is sent, but not the attachment.

I can see the attachment in the most recent history item, but the support customer does not get the attachment. (If I do it manually they get the attachment).

Is there a setting to get the attachment to be sent with the public note?

Thanks again,



Ah, sorry we missed that naming item. Great to hear it’s fixed.

Yes, the attachment issue is a bug and logged for fixing in a future release.


Thanks for you help.