Upload file

58 views
Skip to first unread message

Ivan Saric

unread,
Nov 20, 2012, 6:02:14 AM11/20/12
to granicus-...@googlegroups.com
Hi,
I want to implement a new API into our system instead old one because I heard that there is a new option to upload complete file instead of link to file.
I downloaded a new API but I cannot find anything about this option.
Currently I'm using API to export Agenda from ASP.NET web site. 
Sample code:
//Create Event
granicusEventId = mediaManager.CreateEvent(newGranicusEvent);
//Set HTML Agenda URL
mediaManager.SetEventAgendaURL(granicusEventId, agendaFrameLink);
//Create Event MetaData array(AgendaItem, Document MetaDataData)
var metadatadata = CreateEventMetaData(_currentRecord.Value);
KeyMapping[] keyMapping = mediaManager.ImportEventMetaData(granicusEventId, metadatadata, true, true);

How to upload file into Document and Event from ASP.NET web site into Granicus MediaManager?
Thank you in advance,
Saric Ivan

Javier Muniz

unread,
Nov 26, 2012, 2:10:03 PM11/26/12
to granicus-...@googlegroups.com
Hi Ivan,

Sorry for the delayed response. Do you want to attach a document like a staff report, or are you looking to upload the entire minutes document? 

-javier


From: granicus-...@googlegroups.com [granicus-...@googlegroups.com] on behalf of Ivan Saric [siva...@gmail.com]
Sent: Tuesday, November 20, 2012 3:02 AM
To: granicus-...@googlegroups.com
Subject: Upload file

Ivan Saric

unread,
Nov 27, 2012, 1:43:12 PM11/27/12
to granicus-...@googlegroups.com
Hi Javier,
I want to attach a documents for AgendaItems in Event. Currently we can add a document with link in AgendaItem. 

Javier Muniz

unread,
Nov 28, 2012, 4:23:39 PM11/28/12
to granicus-...@googlegroups.com
Hi Ivan,

You'll definitely need the latest .NET API in order to do this. I recommend compiling it directly from http://github.com/granicus/platform-api-net 

Once you've got latest, you should notice that the Document class has some additional properties:

FileContents
FileExtension

Set the file contents to the content of the file you are uploading (it's a bytearray) and then set the extension to the proper file extension (e.g. "pdf" for pdf files). At that point, you should be able to save the document using your importmetadata call as if it were any other attached document.

If you are uploading a large number of documents this way, sometimes the SOAP call will be so large that it will time out your HTTP request. If that's the case, then we recommend that you upload the agenda without documents, then use the resulting keymap to add the documents one at a time to the proper agenda item. This will also allow you to implement a progress bar in your application, which is nice to have for large exports to give feedback to the user.

Please let me know if you have any questions or would like me or a member of my time to review your code.

Thanks!

-javier

Sent: Tuesday, November 27, 2012 10:43 AM
To: granicus-...@googlegroups.com
Subject: Re: Upload file

Ivan Saric

unread,
Nov 29, 2012, 2:54:57 AM11/29/12
to granicus-...@googlegroups.com
Thank you very much. I did this but I couldn't found this properties. Now everything is OK.
Reply all
Reply to author
Forward
0 new messages