Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't you need some javascript for this? #2

Open
jackttcoms opened this issue Feb 23, 2019 · 7 comments
Open

Don't you need some javascript for this? #2

jackttcoms opened this issue Feb 23, 2019 · 7 comments

Comments

@jackttcoms
Copy link

Does this require any javascript? Also out of 10, how secure would you say this class is? Thanks

@Mehrdad-Dadkhah
Copy link
Owner

Hi @jackttcoms
It needs chunks of file data and yes you can do it with js like flow.js or FineUploader lib.

It By default check list of valid mime types. Do you have any suggestion?

@jackttcoms
Copy link
Author

jackttcoms commented Feb 23, 2019

Wonderful. Not not really. It looks very secure to me 👍 .

Also does this have random file name capabilities? e.g. upload bob.zip and it uploads it as ajhdbfjfbjfbgjkwgbjkgbwjkfwbjkbgj.zip and can you please create a working sample so i can see how it works properly.

Can i explain my needs for my project. Basically I have a form with 5 input fields. I only need the chunking for one field (the zip field), can i achieve this with your class. Do everything at the same time? Click submit.....chunk file and insert data into database?

Here are the fields:
Name
Bio
Image
Image
Zip

Thanks very much.

@Mehrdad-Dadkhah
Copy link
Owner

Ok.

Yes you can. you should set a js lib for Zip input that send chunked data to server then in server you should pass data to my package

@jackttcoms
Copy link
Author

jackttcoms commented Mar 12, 2019

Hi, can this be done with jquery file upload? if so would it be possible for you to create a really simple working example?

This is my code so far based on urs but am unsure with certain elements if i am doing it right so help would be much appreciated in getting a working chunk upload form working. Thanks

<?php
	//add composer autoloader
	require '../vendor/autoload.php';
	
	use MehrdadDadkhah\Video\ChunksUploader;
	
	$uploadHandeler = new ChunksUploader();
$uploadHandeler->setMainFileName('avatar.jpg') //main file name ??? dynamic name
            ->setFileTotalSize($_REQUEST['totalfilesize']) //size of main file (big file)
            ->setInputName('files') //your form input file name
            ->setChunksFolderPath('../chunk-folder') //path to folder for upload chunks files
            ->setUniqueIdentifier('unique-id' . time()); // set unique identifier for each upload (for example user id + time or ...) a unique indentifier per each upload ??? have i done this right
            
            $uploadHandeler->checkAndGenerateOutputDirectory();
            
            $uploadResult = $uploadHandeler->uploadChunk('name-of-chunk-or-chunk-number'); //should be a sortable name ??? confused here
            
            $uploadResult = $uploadHandeler->setUploadDirectory('../uploads') //main directry path to upload (combine chunks here)
			->finishUpload();

Thanks

@jackttcoms
Copy link
Author

Can this work with ResumableJs????

@Mehrdad-Dadkhah
Copy link
Owner

Yes, it can.
You should only pass data that ResumableJs send to server
@jackttcoms

@jackttcoms
Copy link
Author

Any chance of an example of your script in use? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants