Jump to content

Automating an upload (to a website)


Recommended Posts

Hi all,

I've been using a service called Drop.io for some time now, and was wondering if it would be possible to automate the process of uploading files on my "drop".

A drop is, in this case, an online storage medium in the cloud where you can drop things like files and notes.

Here's an example of a drop I've made for this topic: http://drop.io/demo4autoit

I've never used AutoIt's online functions before, so any clues of where to start would greatly be appreciated.

Thanks :)

P.S: Like the new forum style, it's nice.

Link to comment
Share on other sites

I am not totally sure, but I believe it is possible to upload to a website. I think you have to use TCP Protocol. You probably connect to the server and send the information. Look at the source code for the site and replicate whatever the upload button on the website does.

Link to comment
Share on other sites

Yes indeed I figured I should maybe check where the file goes, checking a simplified upload page's source at the moment.

Edit: I think this is the most relevant code I can find :-/

</div>

  </div>
  

  <div id="containerViews">
    <div id="wrapperViews" class="clearfix">
        <div id="upload" class="centeredBox">
  <h2>Upload File</h2>
  <p>Use this HTML uploader to upload a single file to your drop</p>
  <form class="bucket-admin" action="http://assets.drop.io/upload?bucket=65d106e0-52d7-012c-7489-fdb601c2a0a5" method="post" enctype="multipart/form-data" id="upload_form" onsubmit="watchHTMLUpload(this.id,doneUploading)">
    <input type='hidden' name='bucket' value='65d106e0-52d7-012c-7489-fdb601c2a0a5' />
    <input type='hidden' name='checksum' value='f0a2575cf4753e3e2d887ee9a2d89fcbb71d1fa5' />
    <input type='hidden' name='results_in_text' value='true' />
    <input type='hidden' class="referer" name='referer' value='' /> 
    
    <div id="result" class="htmlUploadResultSuccess"></div>
    
    <div class="formContent">
      <fieldset class="v-align">
      <label for="file">File to Upload</label>
      <input id="file" name="file" type="file" />
      <span class='btnBorder ' style='margin-top:10px;margin-left:105px'><button type='submit' class='btn ' style='width:100px' >Upload</button></span>
      </fieldset>
    </div>
    <div>
    <a href="[url="view-source:http://drop.io/demo4autoit"]/demo4autoit[/url]" id="dropReturn" style="margin-top: 30px">Return to drop</a>
    </div>
</div>

<script>
  $("result").fade({from:1,to:0.0001,duration:0});
  function doneUploading(response) {
    if( response.result == "true" ) {
      $("result").className = "htmlUploadResultSuccess";
      $("result").innerHTML = "File Uploaded Successfully";
    } else {
      $("result").className = "htmlUploadResultFailure";
      $("result").innerHTML = "Upload Failed: " + response.message;
    }
    
    $("result").appear({from:0.0001,to:1,duration:0.5});
  }
</script>
Edited by nf67
Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...