Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="col">
- <div class="input-group">
- <label class="input-group-btn">
- <span class="btn" style="background-color:#3BAFDA;">
- Subir foto.<input type="file" accept="image/*" name="img_martillo" class="form-control" id="img_martillo" style="display: none;" capture>
- </span>
- </label>
- <input type="text" class="form-control" readonly>
- </div>
- $nombre_img_martillo=$_FILES['img_martillo']['name']; //Obtiene el nombre de la img.
- $archivo_img_martillo=$_FILES['img_martillo']['tmp_name']; //Contiene el archivo.
- $ruta_img_martillo="files/".$nserie;
- if (!file_exists($ruta_img_canon)) {
- mkdir($ruta_img_martillo);
- }
- $ruta_img_martillo=$ruta_img_martillo."/".$nombre_img_martillo; //files/nombre.jpg
- move_uploaded_file($archivo_img_martillo, $ruta_img_martillo);
- <script type="text/javascript">
- $(function() {
- // We can attach the `fileselect` event to all file inputs on the page
- $(document).on('change', ':file', function() {
- var input = $(this),
- numFiles = input.get(0).files ? input.get(0).files.length : 1,
- label = input.val().replace(/\/g, '/').replace(/.*//, '');
- input.trigger('fileselect', [numFiles, label]);
- });
- // We can watch for our custom `fileselect` event like this
- $(document).ready( function() {
- $(':file').on('fileselect', function(event, numFiles, label) {
- var input = $(this).parents('.input-group').find(':text'),
- log = numFiles > 1 ? numFiles + ' files selected' : label;
- if( input.length ) {
- input.val(log);
- } else {
- if( log );
- }
- });
- });
- });
Add Comment
Please, Sign In to add comment