Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Ticket creation - Attached files don't get stored

We have a web form for our users to submit tickets, but after the latest update, it no longer takes and attaches files correctly.  The web form submits XML data to the API through a HTTP request, and the formatting hasn't changed on our side for some time, as it worked perfectly before.  Now, when it submits, a text file gets stored ok, but a PDF, Word document, and a ZIP file all got dropped off, with only a single < stored for the file.  Can anyone shed some light on where and what needs to change for the new version?

OSTicket 1.10
MySQL 5.5.55
PHP 5.5.9-1ubuntu4.21
Apache 2.4.7
OS: Ubuntu 14.04 LTS


  • With out seeing the form, and the code behind the form... probably not.
  • Please make sure to update your php to 5.6.x. Not an answer to your question but OSTv1.10 doesn't play well with lessor versions.
  • Ok, to update php, we just did a distro upgrade for Ubuntu to 16.04 LTS.  Now, along with that we have:
    MySQL 5.7.18
    PHP 7.0.18-0ubuntu0.16.04.1
    Apache 2.4.18 (Ubuntu).  No change.  

    The code that handles the upload is:
    var httpRequest = (HttpWebRequest)WebRequest.Create(requestUrl);
    httpRequest.Method = "POST";
    httpRequest.ContentType = "application/xml";
    httpRequest.Headers.Add("X-API-Key", apiKey);

    byte[] formData = UTF8Encoding.UTF8.GetBytes(payload);
    httpRequest.ContentLength = formData.Length;

    using (Stream post = httpRequest.GetRequestStream())
    post.Write(formData, 0, formData.Length);

    string responseString = null;

    var response = httpRequest.GetResponse();
    var reader = new StreamReader(response.GetResponseStream());
    responseString = reader.ReadToEnd();
    catch (Exception ex)
    Log("Error: Could not connect to OsTicket server: " + ex.Message);

    return responseString;

    Attached is a sample payload.  the contents of requestUrl referenced above is verified on our system.
Sign In or Register to comment.