Amazon S3 - How to abort uploading a video - asp.net-mvc-4

I am building an application in which a user can upload a video to Amazon S3. I am uploading the video through browser.
Here is my form for uploading:
<form action="FormAction" method="FormMethod" enctype="FormEnclosureType" >
<input id="file-upload-form-key" type="hidden" name="key" value="FileId" />
<input type="hidden" name="AWSAccessKeyId" value="AWSAccessKey" />
<input type="hidden" name="acl" value="Acl" />
<input id="file-upload-form-policy" type="hidden" name="policy" value="Base64EncodedPolicy" />
<input id="file-upload-form-signature" type="hidden" name="signature" value="Signature" />
<input id="file-upload-form-redirect-url" type="hidden" name="redirect" value="RedirectUrl" />
<div class="row">
<label for="Title" style="padding-right: 5px;">Title (optional) </label>
<input id="file-upload-form-title" type="text" name="x-ignore-Title" style="width: 200px;" />
</div>
<div class="row_clear"></div>
<div class="row">
<input id="file-upload-form-file" type="file" accept="video/*" name="file" size="100" id="file"/>
</div>
</form>
I want to implement a cancel button through which a user can abort the uploading. Any help on how this can be done ?
I found this LINK which is similar to my problem. But the solution they have provided is for aborting multipart upload. Also I am not sure if this works when you are directly uploading from the browser.

Related

csrfToken() is not working with html page?

I am having node js backened server and frontend is simple html file running as a spa server.
<h1>Hello World</h1>
<form action="http://localhost:3000/entry" method="POST">
<div>
<label for="message">Enter a message</label>
<input id="message" name="message" type="text" />
</div>
<input type="submit" value="Submit" />
<input type="hidden" name="_csrf" value="{{csrfToken()}}" />
</form>
But it is not working.

Asp .net MVC 4.0 | how can I post a HTML form using URL.Action to a secure page?

I have a HTML form on a page which is not running on the secure binding but I need to post this form to a secure page. Now issue I am facing is that my form data gets lost when I submit this form.
I am using following following code for the form:
<form id="pdp-form" action="#Url.Action("action", "Controller")" method="post">
<input type="hidden" value="" name="Size" id="pdp-size">
<input type="hidden" value="" name="ProductId" id="pdp-code">
<input type="hidden" name="Product" id="pdp-ProductName" value="Product Name">
<input type="hidden" name="Category" id="pdp-Category" value="Category Name">
<input type="hidden" value="buyID" name="ProdBuyId" id="ProdBuyId">
</form>
How can I post my from on the secure page without loosing my data?
Note : Secure page where we are posting the form has both get and post methods.
i don't know what are you trying to do, but you're missing the submit button
<button type="submit">Submit</button>
<form role="form" action="#Url.Action("action", "Controller")" method="post">
<input type="hidden" value="" name="Size" id="pdp-size">
<input type="hidden" value="" name="ProductId" id="pdp-code">
<input type="hidden" name="Product" id="pdp-ProductName" value="Product Name">
<input type="hidden" name="Category" id="pdp-Category" value="Category Name">
<input type="hidden" value="buyID" name="ProdBuyId" id="ProdBuyId">
<button type="submit">Submit</button>
</form>

using Bootstrap3 form in laravel5.1

I am trying to make a form using bootstrap3 in laravel5.1 so that I can get values from user and store it on the database and want to redirect the same page.
here is the form part of my code --
<div class="row">
<form action="{{url('fastshops/menu')}} " method="post" role="form">
<legend>ADD NEW ITEM</legend>
<div class="form-group">
<label for=""></label>
<input type="text" class="form-control" name="ItemID" id="" placeholder="Item ID...">
<label for=""></label>
<input type="text" class="form-control" name="ItemName" id="" placeholder="Item Name...">
<label for=""></label>
<input type="text" class="form-control" name="SellPrice" id="" placeholder="Sell Price...">
<label for=""></label>
<input type="text" class="form-control" name="NetPrice" id="" placeholder="Net Price...">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
but this part action="{{url('fastshops/menu')}} is not working ! If I click on the submit button I am having TokenMismatchException ! please help me out.
thanks in advance.
add this
<input type="hidden" name="_token" value="{{Session::token()}}"/> or
<input type="hidden" name="_token" value="{{csrf_token()}}"/>
inside your form.
Laravel 5 automatically check for CSRF on all Post request for all the routes. Read the docs, they are pretty self explainatory

File upload to s3 using HTML form not working

<form action="https://bucketname-sellercentral.s3.amazonaws.com/" method="post" enctype="multipart/form-data">
<input type="hidden" name="key" value="uploads/${filename}">
<input type="hidden" name="AWSAccessKeyId" value="GGGGGGGGGG46IITQQ">
<input type="hidden" name="acl" value="private">
<input type="hidden" name="success_action_redirect" value="http://192.168.1.4:8443/test">
<input type="hidden" name="policy" value=<policy>
<input type="hidden" name="signature" value=<signature>
<input type="hidden" name="Content-Type" value="image/jpeg">
<input name="file" type="file" >
</form>
Here if in the key field i put value="uploads/tulips.jpg" it works but if i do not specify the filename it is not working ie value="uploads/${filename}" does not work
it does not throw an error or exception is simply is not visible in my s3 bucket

How to send the http get in Rebol to download an wordpress xml backup file?

I would like to use rebol to download an xml backup of my blog from
http://reboltutorial.com/wp-admin/export.php
the form is
<form action="" method="get">
<h3>Options</h3>
<table class="form-table">
<tr>
<th><label for="author">Restrict Author</label></th>
<td>
<select name="author" id="author">
<option value="all" selected="selected">All Authors</option>
<option value='1'>admin</option></select>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="submit" class="button" value="Download Export File" />
<input type="hidden" name="download" value="true" />
</p>
</form>
I guess I would first need to log in http://reboltutorial.com/login/ and then what after ?
Any code example to do similar stuff (getting the cookie, ...) ?
<form name="loginform" id="loginform" action="" method="post">
<p>
<label>Username<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" /></label>
</p>
<p>
<label>Password<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
</p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me</label></p>
<p class="submit">
<input type="hidden" name="post-from" id="post-from" value="page" />
<input type="hidden" name="action" id="action" value="login" />
<input type="submit" name="wp-submit" id="wp-submit" value="Log In" />
<input type="hidden" name="redirect_to" value="http://reboltutorial.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
Try this
http://rebol.wik.is/Protocols/Http