Page 1 of 1 1
Topic Options
#168141 - 2006-09-20 09:56 PM File transfer using HTTPS
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
Calling all master kixters.
I have searched and I cannot find any method of automating an HTTPS file transfer other than third party utilities.
Anyone care to help me out here?
_________________________
Taxation WITH representation isn't so hot, either!

Top
#168142 - 2006-09-20 10:28 PM Re: File transfer using HTTPS
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well... https involves certs... not that simple stuff...
Top
#168143 - 2006-09-21 02:48 PM Re: File transfer using HTTPS
Stanley Offline
Starting to like KiXtart

Registered: 2004-06-03
Posts: 130
Loc: Upstate NY, USA
I do have this bit of PERL code , but I do not know PERL and whoever wrote it did not DOCUMENT it.
Perhaps someone can explain to a jack of all trades, master of none, exactly what the h e double toothpicks is going on here.

#!/bin/bash

if test $# -ne 1
then
echo "Usage: `basename $0` " 1>&2
exit 1;
fi

FILENAME=$1
BASENAME=`basename $FILENAME`

export EMAILTO=${EMAILTO:=personsendingfileemail@somewhere.com}
export BASICUSER=${BASICUSER:=}
export BASICPASSWD=${BASICPASSWD:=export PROXYUSER=${USER:=your_userid}
export PROXYPASSWD=${PASSWD:=your_password}
export CURLPROXY=${CURLPROXY:=YOURproxy:80}

PROXY="--proxy-user $PROXYUSER:$PROXYPASSWD --proxy ${CURLPROXY}"

rm -f cookies.txt

curl \
--verbose \
-s \
--insecure \
$PROXY \
--cookie-jar cookies.txt \
--cookie cookies.txt \
-D step1Hdr.txt \
https://transfer.SOMEWHERE.com/ft/

curl \
--basic \
--user "${BASICUSER}:${BASICPASSWD}" \
--verbose \
-s \
--insecure \
$PROXY \
--cookie-jar cookies.txt \
--cookie cookies.txt \
-D step1Hdr.txt \
https://transfer.SOMEWHERE.com/ft/iu/

curl \
--basic \
--user "${BASICUSER}:${BASICPASSWD}" \
-F fromEmail=$EMAILTO \
-F submit=Submit \
--verbose \
-s \
--insecure \
$PROXY \
--cookie-jar cookies.txt \
--cookie cookies.txt \
-D step2Hdr.txt \
https://transfer.SOMEWHERE.com/ft/iu/selectFile.php

curl \
--basic \
--user "${BASICUSER}:${BASICPASSWD}" \
-F "file[]=@$FILENAME;type=application/octet-stream;filename=$BASENAME" \
-F submit=Upload \
--verbose \
-s \
--insecure \
$PROXY \
--cookie-jar cookies.txt \
--cookie cookies.txt \
-D step3Hdr.txt \
https://transfer.SOMEWHERE.com/ft/iu/uploadFiles.php

Top
#168144 - 2006-09-21 03:10 PM Re: File transfer using HTTPS
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
that's no perl, that's bashing (if my eyes are not misstaken
Top
#168145 - 2006-09-21 04:13 PM Re: File transfer using HTTPS
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Indeed it is.

The BASH script is just running the "curl" command line tool to do the transfer. If you have the tool installed you can do exactly the same thing with a KiXtart script.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.055 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org