public void addAttachment(long pageId, string mime, string comment, string filename, IBinaryContainer image)
        {
            checkCredentials();
            RemoteAttachment attachment = new RemoteAttachment();

            // Comment is ignored, see: http://jira.atlassian.com/browse/CONF-9395
            attachment.comment     = comment;
            attachment.fileName    = filename;
            attachment.contentType = mime;
            confluence.addAttachment(credentials, pageId, attachment, image.ToByteArray());
        }
Esempio n. 2
0
        public RemoteAttachment AddAttachment(string fileName, string title, string parent, string space, string comment)
        {
            try
            {
                byte[]           data       = null;
                RemoteAttachment attachment = new RemoteAttachment();
                data = File.ReadAllBytes(fileName);
                attachment.fileName    = Path.GetFileName(fileName);
                attachment.contentType = "application/zip";
                attachment.comment     = comment;
                attachment.created     = DateTime.Now;

                RemotePage page = GetPage(title, parent, space);
                attachment = m_soapService.addAttachment(m_soapAuthToken, page.id, attachment, data);

                return(attachment);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine("Error adding attachment: " + ex.Message + Environment.NewLine + "Location: " + ex.StackTrace);
            }
            return(null);
        }
Esempio n. 3
0
 public RemoteAttachment AddAttachment(RemoteAttachment attachment, long pageId, byte[] fileBytes)
 {
     return(_service.addAttachment(_authToken, pageId, attachment, fileBytes));
 }