logo       

Re: Upload binary files with xml-rpc?: msg#00045

Subject: Re: Upload binary files with xml-rpc?
Helge Hess wrote:

On 28. Apr 2005, at 19:39 Uhr, Rafel Amer Ramon wrote:

I have tried to upload a binary file with the command
server.project.newDocument

If a send the file as a binary string, I get an error from
python and if I send it as a base64 encoded string, it is not
decoded by opengroupware.


I remember a discussion of this in the past, maybe you should check the archives. Of course it should be possible, but I remember that there was some weirdness.

It is possible to upload binary files with
XML-RPC anb how can I do it?


Notably using HTTP for file transfers is _much_ more efficient. Just issue a PUT to ZideStore (/zidestore/dav/$user/Projects/$projectcode/ $docpath).

Greets,
  Helge

Also, it is possible modifie the file
DocumentAPI/OGoDatabaseProject/SkyProjectFileManager.m
to check if the data arrived is encoded in base64:

   ////////////
   NSData *data;
   NSString *str;
   str = [[NSString alloc] initWithData:_contents
               encoding:NSUTF8StringEncoding];
   data = [str dataUsingEncoding:NSUTF8StringEncoding];
   if(!(data = [data dataByDecodingBase64])) data = _contents;
   fileSize = [NSNumber numberWithInt:
                          (int)((data) ? [data length] : 0)];

   // TODO: this did not set checkaccess to no!
   doc = [self _newFileDocAtPath:_path withName:name abstract:abstract
       ownerPrimaryKey:ownerId
       parentPrimaryKey:
         [[attrs objectForKey:@"globalID"] keyValues][0]
       content:data doNotCheckAccess:NO];
   ////////////

Then, if the data arrived is encoded in base64, it is decoded.


R. Amer
Polythecnic University of Catalonia
--
OpenGroupware.org XML-RPC
xmlrpc@xxxxxxxxxxxxxxxxx
http://mail.opengroupware.org/mailman/listinfo/xmlrpc



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    politics.lenini...    audio.emagic.ex...    tex.texinfo.gen...    handhelds.linux...    ietf.sipping/20...    lang.erlang.gen...    cygwin.talk/200...    yellowdog.gener...    mozilla.devel.l...    xfree86.newbie/...    openbsd.ports/2...    db.oracle.devel...    kde.kalyxo.deve...    user-groups.lin...    bbc.cvs/2003-04...    gnu.libtool.bug...    redhat.k12osn/2...    emulators.wine....    freebsd.devel.d...    search.xapian.g...    java.izpack.use...    network.mrtg.us...    windows.total-c...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe