Issue with URL parser -- adding attachments

Discussion created by 7825309 on Oct 22, 2015

Hi all,


There seems to be an issue with the parser for filenames when adding attachments. I am finishing up our migration script to take all our data from Zendesk and import into samanage and this is the final hurdle.


Here's the break down...If uploading a file from your local host, everything works as planned. However, being as though Zendesk also stores attachments in an s3 bucket (same as samanage), I needed a way to import them directly.


The following DOES upload the file (tested by downloading and opening), it just gives the wrong file name. And there is no ability to over-ride this with another form entry (ie: -F "filename=test.doc" or -F "file[filename]=test.doc").


Here's the curl call from command line...


curl --digest -u '<user>:<password>' -F "file[attachable_type]=Comment" -F "file[attachable_id]=3419920" -F "file[attachment]=https://somerandom.zendesk.com/attachments/token/asdh12fasfjhkas22/?name=This+is+a+test.doc" -H 'Accept: application/vnd.samanage.v1.3+xml' -H 'Content-Type: multipart/form-data' -X POST https://api.samanage.com/attachments.xml


The filename that is attached to the incident is named 'asdh12fasfjhkas22'. Essentially the parser is pulling out the token used to auth against s3 and using it as the filename.


Anyhow else ran into this or have a way around it? I've opened a ticket with support, yet no response as of yet.


For the record, we are migrating all tickets from Zendesk to samanage, retaining the description, all comments and attachments and tracking the old Zendesk ticket via a custom field. I'll share the script if anyone thinks it might be useful.