HazzardWeb

HazzardWeb supports this item

Supported

This author's response time can be up to 1 business day.

76 comments found.

guia365

guia365 Purchased

hi,

Is your script not by cookie or session? Anyone you access can see?

thanks

guia365

guia365 Purchased

How do I show uploaded files only for user’s session?

Hi,

I need to reload a datatable I have in the page…how can do it with your javascript? need put this code $('#casosDocList').DataTable().ajax.reload(null, false); inside of success function… can you help me?

Best Regards!

now is working properly…I just copied the filepicker.js you have and works…maybe in the downloaded file something was bad… all is ok now just the file always return and show it all of them in each user. I just use this

$handler->on('files.fetch', function (&$files) { }); like that empty..but always return me all the files even if the id user doesn’t upload anything yet
Use:
$handler->on('files.fetch', function (&$files) {
 $files = [];
});

Thank you Hazzard! now all is ok!

how I’ll use ASPX . how I want to use files c#

Hi, this only works with PHP.

Hi i have a form (<input type=”file” id=”publisher-photos” name=”postPhotos[]” multiple=”multiple” >) with that send the info by ajaxform plugin to this script:

if (isset($_FILES‘postPhotos’) && empty($mediaFilename) && empty($_POST[‘album_name’])) { if (count($_FILES‘postPhotos’) == 1) { $fileInfo = array( ‘file’ => $_FILES“postPhotos”[0], ‘name’ => $_FILES‘postPhotos’[0], ‘size’ => $_FILES“postPhotos”[0], ‘type’ => $_FILES“postPhotos”[0] ); $media = Wo_ShareFile($fileInfo); if (!empty($media)) { $mediaFilename = $media[‘filename’]; $mediaName = $media[‘name’]; } } else { $multi = 1; } }

with the filepicker is possible replacement the $_FILES“postPhotos”[0] for the data that get the filepicker?

Hi, Filepicker will handle the upload independently from your form and send it to the server. See this http://docs.hazzardweb.com/filepicker/2.0/quick

I need that pass with this script cause is part of a social plattform and the script handlle with anothers functions

hello, I can only insert a record in the database, the second is not public, please help me? $idlogininsadm no work, $idcorso it’s ok work, why?? I did so:

$handler->on(‘upload.success’, function ($file) use ($handler) {

$idcorso = $handler->request()->get(‘id’); $idlogininsadm = $handler->request()->get(‘idadm’);

// insert $filename into your database. // parametri di connessione $host = “Localhost”; $user = “user”; $passwordserver = “pass-n”; $db = “namedb”;

$conn=mysql_connect($host, $user, $passwordserver); mysql_select_db($db);

$sql2 = “INSERT INTO d_corsi_file (titolo_file, id_corsi, file, id_login_ins_adm, data_ins_adm, ora_ins_adm) VALUES (’$titolo_file’, ’$idcorso’, ’$filename’, ’$idlogininsadm’, curdate(), curtime())”; mysql_query($sql2, $conn) or die (mysql_error());

});

Hi, how do you send the idadm parameter ?

sorry I did not understand

I see you try to access the idadm parameter, how did you send it ? Using the data option ?

Hi there. Apologies if I missed this answer elsewhere—is it possible to restrict the crop by ratio? i.e. crop at a 3×2 ratio only?

Fantastic, thank you!

bacalov

bacalov Purchased

Hi, Nice job putting all these scripts all toghether.

Hi ,

Is it possible to add any kind of lossless compression from client side to images while uploading ? I would like to buy such uploader .Is this possible from this uploader ?

Can u please let me know what libraries it requires and can i integrate it ?

What I meant is that it can’t be don’t with the script as it is, so it would require something extra but I don’t know which one.

https://github.com/brunobar79/J-I-C can i integrate this script with your script ?

hi , Quite urgent .It seems like i cannot able to upload file greater than 10MB ,it stuck in “processing” status and in console ,it showing error message “filename is undefined”..

Please check

Make sure you increase the post_max_size, upload_max_filesize and memory_limit directives in your php.ini file (http://php.net/manual/en/ini.list.php).

Hi Hazzard,

I need to know how can I resize the images, per example if I have a picture or pictures with 2448 × 3264 dimentions(width x height) , and with a 2.4 mb of size, how can I resize it to 600 of height and maybe 1 mb or less of size?

without of crop function

hello????

Hi, you can only have predefined presets of what width/height you want. But you can’t create it based on the file size.

If you want something custom use the upoader events ( http://docs.hazzardweb.com/filepicker/2.0/apiphp#available-events ) and create your own image version ( http://docs.hazzardweb.com/filepicker/2.0/apiphp#image-object ).

Hello I was very interested in your script. But I have a question. Is it possible to insert into the database when I make multiple uploads? Comes with some example along with the files to insert into the database?

Thanks for the support. Yes. Within the upload methods I can retrieve the value of the inputs using the “date” and the handler. But how do I retrieve the album id out of the methods to configure the folder

Use the init event http://docs.hazzardweb.com/filepicker/2.0/apiphp#available-events . It’s fired on initialization before any other event.

$handler->on('init', function () use ($handler, $config) {
  $id = $handler->request()->get('album_id');

  $config['upload_dir'] = __DIR__."/../files/album_{$id}";
});

Thank you for the support. Works fine. Best support and script.

I have a question. Is it possible to add multiple uploaders to one page? I would like to give the user a possibility to upload to a public folder and to a shared (private) folder.

Now I created both with it’s own templates to upload and a different upload folder. #filepicker1 and $(’#filepicker1’).filePicker({}); #filepicker2 and $(’#filepicker2’).filePicker({});

Hoever when I use the buttons inside filepicker2 it is using the template of filepicker1 and the file is being uploaded in the folder which is configured for filepicker1.

Can you tell me what to do?

What was the problem then ?

I actually don’t know. I copied the source code from the page you posted into my source code of plus.php. After that I copied the filepicker.js source and pasted into my code. And it worked!

What version of Filepicker did you used before ?

Is it possible to have multiples instances like your avatar.php? I need two filepickers for upload two avatars file but i need to use your template avatar.php

Can you show me the code

var cropBtn = $(’.crop-btn’); var deleteBtn = $(’.delete-btn’);

$(’#filepicker’).filePicker({ _token: $(‘meta[name=”csrf-token”]’).attr(‘content’), url: ’/uploader/avatar.php’, acceptedFiles: /(\.|\/)(gif|jpe?g|png)$/i, plugins: [‘drop’, ‘camera’, ‘crop’], crop: { aspectRatio: 1, // Square showBtn: cropBtn } }) .on(‘add.filepicker’, function (e, data) { var file = data.files0; }) .on(‘done.filepicker’, function (e, data) { // Here the file has been uploaded. var file = data.files0; }) .on(‘cropsave.filepicker’, function (e, file) { // Here the image has been cropped. }) .on(‘fail.filepicker’, function () { alert(‘Oops! Something went wrong.’); });

// Update the avatar image.
$('.avatar_perfil').attr('src', file.versions.avatar.url '?' new Date().getTime());
// Update the button fileurl.
cropBtn.data('fileurl', file.url).show();
deleteBtn.data('file', file.name).show();

// When clicking on the delete button delete the file. deleteBtn.on(‘click’, function () { // Delete the file. $(’#filepicker’).filePicker().delete($(this).data(‘file’)); });

// Reset default avatar.
$('.avatar_perfil').attr('src', 'https://www.gravatar.com/avatar/?d=mm&s=300');
// Hide crop and delete buttons.
cropBtn.hide();
deleteBtn.hide();

And this for the filepicker2 $(’#filepicker2’).filePicker({ _token: $(‘meta[name=”csrf-token”]’).attr(‘content’), url: ’/uploader/avatar2.php’, acceptedFiles: /(\.|\/)(gif|jpe?g|png)$/i, plugins: [‘drop’, ‘camera’, ‘crop’], crop: { aspectRatio: 1, // Square showBtn: cropBtn } }) .on(‘add.filepicker’, function (e, data) { var file = data.files0;

if (file.error) {
        e.preventDefault();
        alert(file.error);
    }
})
.on('done.filepicker', function (e, data) {
    // Here the file has been uploaded.
    var file = data.files[0];
})
.on('cropsave.filepicker', function (e, file) {
    // Here the image has been cropped.
})
.on('fail.filepicker', function () {
    alert('Oops! Something went wrong.');
});
// Update the avatar image.
$('.avatar_website').attr('src', file.versions.avatar.url '?' new Date().getTime());
// Update the button fileurl.
cropBtn.data('fileurl', file.url).show();
deleteBtn.data('file', file.name).show();
// When clicking on the delete button delete the file.
deleteBtn.on('click', function () {
    // Delete the file.
    $('#filepicker2').filePicker().delete($(this).data('file'));
});
// Reset default avatar.
$('.avatar_website').attr('src', 'https://www.gravatar.com/avatar/?d=mm&s=300');
// Hide crop and delete buttons.
cropBtn.hide();
deleteBtn.hide();

Please send me the entire file @ hazzardweb@gmail.com .

I’ve purchased and integrating this script. I’ve 2 quick questions, 1. Can i set the transparent PNG/GIF images background, as it is. Because its currently changing background to black 2. I don’t want to have a fix width and height image, but I want a scaled image as version. But it should Fill the empty space, in other words negative cropping. so that if an image is 15×15 and i want an image of 100×100 it should fill the empty space keeping the actual size of image (15×15) but white space to make it 100×100.

Hi, currently the library that I use to work with images doesn’t support transparent backgrounds.

You can just use the max_width / max_height, but if you want to upscale it, you have to use fixed with / height.

This comment is currently being reviewed.

This comment is currently being reviewed.

This comment is currently being reviewed.

This comment is currently being reviewed.

Hi hazzard,

I have problem when the images are up of 2 mb… always said me this:

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12096 bytes) in /home/-------/public_html/-------/vendor/intervention/image/src/Intervention/Image/Gd/Commands/RotateCommand.php on line 22

The thing is I already change the memory_limit and the upload_max_filesize to 128mb each… so my question is why I have this error?

can this be fix it?

Best regards!

Set memory_limit to 512.

ok. one question… if the file or files are up of 10 mb or larger I will need to change to1024??

Will be better if your script serves the file in parts, keeping memory low.

like this function:

function readfile_chunked ($filename,$type='array') { $chunk_array=array(); $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { switch($type) { case'array': // Returns Lines Array like file() $lines[] = fgets($handle, $chunksize); break; case'string': // Returns Lines String like file_get_contents() $lines = fread($handle, $chunksize); break; } } fclose($handle); return $lines; }

Regards!

The way you read the file doesn’t have to do with the memory limit error you get when handling images. Because the script uses GD by default it requires more memory. If you have installed imagick you can use it: http://docs.hazzardweb.com/filepicker/2.0/configphp#usage It’s faster and doesn’t require that much memory.

by
by
by
by
by
by