Home
TeamSite
uploading into teamsite via perl
hoglis
For some very silly reason, I have to automatically upload/import some files into a teamsite 5.5.2 system.
I choosed perl for this task. After some testing I can now generate a teamsite session but the upload process is still a problem.
As counterpart I use iwfileupdownload.cgi which accepts the file in a "application/x-binary" request.
I built a request like this:
$req = new HTTP::Request POST => "$HMMH::TSSERVER/iw-bin/iwfileupdownload.cgi";
$req->content_type('application/x-binary');
$req->content(file%5flength:13\nsession%5fstring:$HMMH::session_string\n" .
"file%5fvpath:default/main/ABCDEF/ABCDEF%5fPROD/WORKAREA/Develop/dummy.htmll\n" .
"command:upload\n" .
"command:upload\n" .
"Some Xestdata\n");
added som header information (Cache-Control, Pragma, Accept) and ended with this error message
Error: Query length less than it should be
Can anybody help? Even a hint that perl is not the proper language is appreciated.
Thanks
Holger
Find more posts tagged with
Comments
Dwayne
Have you looked at CSSDK?
I'm normally a pretty big Perl proponent, but, in this case, it seems like you're trying to open a door with a sledgehammer. Yes, you can make it work, but it will be messy.
CSSDK has facilities for creating and writing files from a remote machine. I think it would be "cleaner" than trying to tweak an HTTP connection into doing what you want from Perl.
--
Current project: TS 5.5.2/6.1 W2K
hoglis
Do you mean ContentServices SDK? (I had to google)
From the name I apologize, that it's a client/server solution, but I have no direct access to the server :-/
screenshot.jpg
Dwayne
Sorry for the acronym. Yes, I meant ContentServices SDK
I'm not sure what you mean by "no direct access to the server." As long as the server component of CSSDK is installed on the server, then the access you need is the same as what you'd need for your Perl solution, using the upload URL. Your java application would use CSSDK to establish a SOAP session to the server, and all communication would happen using SOAP. You'll need to provide a valid username/password/role to your application, but that would be true for your Perl script as well.
--
Current project: TS 5.5.2/6.1 W2K
hoglis
"no direct access" means "no shell, no ftp, no console, no scp, no samba" just WebDesk(pro)
And after a further look into the forum, I think CSSDK 2.0 is TS6 only but I have (only) TS5.5.2 :-/
Dwayne
Yes, CSSDK 2.0 is only available on TS 6+, but I believe that the functions you need were also available on CSSDK 1.x, which is available for TS 5.5.2
--
Current project: TS 5.5.2/6.1 W2K
Migrateduser
Holger,
Talking to iwfileupdownload.cgi is not a good idea. This is considered
an internal interface so the protocol can freely change, and that protocol
did change between service packs of 5.5. It no longer ships as of 6.5.
You should check out CS 1.x and see if that can do it. I have never used
CS version 1, myself....
As far as the API goes, CS 2.x can definately handle the job, and in fact
the replacement for iwfileupdownload uses CS in TeamSite 6.5.
Jason Heirtzler
Interwoven Engineering