The html page of the form data is as below
<form name="uploadform" id="uploadform" action="htmlupload.php" enctype="multipart/form-data" method="post"> <table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center"> <tr> <td class="tcat"> Upload Files </td> </tr> <tr> <td class="panelsurround" align="center"> <div id="upload" class="panel"> <div style="width:720px" align="left"> <table border="0"><tr> <td> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> </td> <td> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> </td> <td> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> <div><input name="attachment[]" type="file"></div> </td> </tr></table> </div> <div style="margin-top:6px"> <input value="6ece14a18366a322c347c71cbfe87420" name="uploadcode" type="hidden" /> <input value="upload" name="do" type="hidden" /> <input value="upload" name="uploadbutton" onclick="onClickVerify();" class="button" type="button" accesskey="s" /> <input type="reset" class="button" value="Reset Fields" accesskey="r" /> </div> </div> <div class="panel" id="status" style="display:none;width:100%;"> � </div> </td> </tr> </table> </form>
I am trying to post files and upload using the curl command, tried the below two commands
curl -b cookie.txt -d "attachment[]=@1.png&do=upload" http://f7.masaladesi.com/htmlupload.php curl -b cookie.txt -F "attachment[]=@1.png" http://f7.masaladesi.com/htmlupload.php
The image of the webpage(public one if you are registered)
Please give me a hint on how to achieve this, it is an array of selecting the attachments
---------- Post updated at 10:37 AM ---------- Previous update was at 06:25 AM ----------
Tried with the below command
curl -b cookie.txt --form "attachment[]=@1.png" --form "do=upload" myurl
But it says "invalid upload" in the resulting webpage. That means the upload button works, something wrong while sending the attachment
---------- Post updated at 10:41 AM ---------- Previous update was at 10:37 AM ----------
Also the webpage is a forum, it is same as clicking on "Manage Attachments" button after create a new thread. You will see an array of Browse button with an ' upload' at the end