LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   CURL issues in bash (http://www.linuxquestions.org/questions/programming-9/curl-issues-in-bash-793857/)

iniuria 03-07-2010 06:49 PM

CURL issues in bash
 
Hi, i'm trying to write a bash script to upload an image to pixhost.com, but i can't get i working properly.

Everytime i try, the html returns me a error saying "Upload is disabled during short maintenance work (ETA 10 minutes). Brb!", while from the browser everything works fine.

This is my current command line:
Code:

curl -L -b cookie-pix.txt -c newcookie.txt www.pixhost.org/cover-upload -A "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"  -F 0=@/home/admin/Desktop/karm.jpg -F content_type=0 -F press=Upload
And this is the html of the form:
Code:

<form name="upload" method="post" onsubmit="return image(upload);" enctype="multipart/form-data" action="http://www.pixhost.org:8080/cover-upload/">

<h3>Select pictures:&nbsp;</h3><br />
<div style="padding-bottom:5px;">
<input type="file" name="0" style="margin-top:2px;"/><br />
<input type="file" name="1" style="margin-top:2px;"/>
</div>

<div style="padding-bottom:5px;">
<input type="file" name="2" style="margin-top:2px;"/><br />
<input type="file" name="3" style="margin-top:2px;"/>
</div>

<div id="viac"></div>
<div style="margin-top:4px;"><a onclick="coverupload();">More</a><br /></div>

<div style="padding-top:5px;">Content type:
 <input type="radio" name="content_type" value="1"/> Adult (XXX)
 <input type="radio" name="content_type" value="0"/> Family safe
</div>

<div style="padding-top:5px;">Connect pictures: <input type="checkbox" name="split"/></div>

<div style="padding-top:5px;"><h3>I agree with <a href="/tos/">TOS</a> <input type="checkbox" name="tos" checked="checked"/></h3><br /><br />Supported formats: gif, png, jpg.<br />Maximum image size is 5 MB.</div>

<div style="padding-top:20px;"><input type="submit" value="Upload"/></div>
</form></div>
</div>

Any idea on what the problem could be? Thanks

kbp 03-08-2010 03:39 AM

Did you check the TOS checkbox in your curl command line? ... otherwise it could be a cookie issue


All times are GMT -5. The time now is 09:28 PM.