Skip to content
WJunction - Webmaster Forum

streamcloud.eu bash upload

Status
Not open for further replies.

WD40

Established Member
280
2011
131
Hey everyone

I've been struggling with this host for some time now and I can't figure out the problem. Here's the script I wrote:

Code:
#!/bin/bash

id2="`date +%y%m%d%H%M%S`$RANDOM"
cjar="/tmp/$id2"


function streamcloud_login {
    local user="xxxx"
    local pass="xxxxx"
    curl --cookie-jar $cjar --data "op=login&login=$user&password=$pass&submit=Submit&redirect=http://streamcloud.eu/?op=upload" http://streamcloud.eu/?op=login
}


function streamcloud_upload {
    local file="$1"
    local DATA=$(curl --cookie $cjar http://streamcloud.eu/?op=upload)


    
    SESS_ID=$(echo "$DATA" | grep 'sess_id' | sed 's/.*"\(.*\)"[^"]*$/\1/')
    SRV_TMP_URL=$(echo "$DATA" | grep "srv_tmp_url" | sed 's/.*"\(.*\)"[^"]*$/\1/')
    SRV_TMP_URL_2=$(echo "$SRV_TMP_URL" | sed 's/:8080\/tmp/\/cgi-bin\/upload.cgi?upload_id=/')
    DISK_ID=$(echo "$DATA" | grep "disk_id" | sed 's/.*"\(.*\)"[^"]*$/\1/')
    SRV_ID=$(echo "$DATA" | grep "srv_id" | sed 's/.*"\(.*\)"[^"]*$/\1/')
    UPLOAD_ID=$(shuf -i 100000000000-999999999999 -n 1)
    
    echo "SESS_ID:" $SESS_ID
    echo "SRV_TMP_URL:" $SRV_TMP_URL
    echo "SRV_TMP_URL2:" $SRV_TMP_URL_2
    echo "DISK_ID:" $DISK_ID
    echo "SRV_ID:" $SRV_ID
    echo "UPLOAD_ID:" $UPLOAD_ID
    
    
    PAGE=$(curl -L --cookie $cjar \
        -F "upload_type=@$file" \
        -F "sess_id=$SESS_ID" \
        -F "disk_id=$DISK_ID" \
        -F "srv_id=$SRV_ID" \
        -F "srv_tmp_url=$SRV_TMP_URL" \
        "$SRV_TMP_URL_2")
    echo "$PAGE" >> sc_up.html


}
streamcloud_login


streamcloud_upload spacetestSMALL_512kb.mp4


Here are the two errors I'm getting:

Code:
<HTML><HEAD><Script>alert('\''ERROR: Invalid Disk ID'\'');</Script></HEAD><BODY><b>ERROR: Invalid Disk ID</b></BODY></HTML>

or

Code:
curl: (52) Empty reply from server


Can anyone take a look and try to figure out what's wrong here. I'm pretty much clueless atm. Here is the form report:

Code:
--- FORM report. Uses POST to URL "http://upload7.streamcloud.eu/cgi-bin/upload.cgi?upload_id="--- type: multipart form upload [use -F]
Input: NAME="upload_type" VALUE="file" (HIDDEN)
Input: NAME="sess_id" VALUE="t759luhl5i11nr0y" (HIDDEN)
Input: NAME="srv_tmp_url" VALUE="http://upload7.streamcloud.eu:8080/tmp" (HIDDEN)
Input: NAME="srv_id" VALUE="74" (HIDDEN)
Input: NAME="disk_id" VALUE="01" (HIDDEN)
Input: NAME="file" (FILE)
Input: NAME="fakefilepc" (TEXT)
Input: NAME="file_title" (TEXT)
Textarea: NAME="file_descr"
Input: NAME="tags" (TEXT)
Input: NAME="file_public" VALUE="1" (CHECKBOX)
Button: "+ upload slot" (BUTTON)
Input: NAME="tos" VALUE="1" (CHECKBOX)
Input: NAME="submit_btn" VALUE=" Upload! " (SUBMIT)
--- end of FORM


Thanks
 

1 comment

Hi, sorry if this doesn't help, I only know php. In my script I submit the disk_id as POST and as GET. I'm not sure if you do this in your script since i don't reeally understand it. Here is how it works for me (the url I post the data to):
PHP:
$link = $uploadform."&utype=reg&disk_id=".$postfields['disk_id'];
//$postfields['disk_id'] is the disk id of course, $uploadform is the url you get from the form (srv_tmp_url)

so in short try to add disk_id and uptype as GET variables if you haven't already.

Hope it helps,

Bronko
 
Status
Not open for further replies.

About the author

W
Established Member · Joined
280
Messages
131
Reactions
231
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom