As I know it is complicated to deal with files for "security", it is very restricted, but you can get information such as name, ext, size, etc. My goal is for the user to upload an image and to reduce the weight of this image for when it is sent to the server. I know of app's that do it, but they don't share api, is there a way to do this with jquery?
$(document).ready(function(){
$("#form").submit(function(e){
e.preventDefault();
//Cómo le bajo el peso a la imagen subida?
//$.ajax...
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<form action="myAction" id="form" method="POST" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="enviar" />
</form>
This website: http://punypng.com offers an API that you can insert into your web page to compress images. If you prefer to program it yourself, with jQuery it is difficult, I recommend you use PHP.