khanzadimahdi/UploadManager

Temp folder for the chunks?

jackttcoms opened this issue ยท 25 comments

Hi, is it possible to when uploading files to store the chunks in a temp folder until complete and then move them to main folder?

Also in the future can you add the ability to create directories if not found as that would be helpful. Thanks

Thanks

yes it is. you see examples. you can check if originalFileSize === uploadedFileSize and if true that means upload has been completed.
this package is not responsible for your directories. you must make them and configure the package at first.

Ok thanks and one other thing.

I am experimenting at the moment and am building a form where you have content, image1, image2 and file. I only need the file field chunked but is there a way to do it all in one go. So basically chunked uploads + additional form data fields

If your class cannot do this or if i am going about it the wrong way, how would you suggest i go about doing it. Thanks

Step by step for my aim

  • enter all details
  • add the files
  • click submit which then processes data
  • show progress bar showing chunking in progress, after chunked then submit form details along with fileupload name ready for insert into the database.

you have done that in a right way.
i think its better to return a response when uploading all files has been completed and then submit the form. ( you can disable all form fields until the progress has finished)
you can store uploaded file's in database and put their id in the form, then its time to submit all datas.

Right. I know this might sound silly but please can you show me an example of the additional fields as i cannot figure out how to allow the two to work together. Thanks

i am so busy these days. i can create an example for you if your are not in a hurry and can wait a least a week.

that would be wonderful thankyou so much

Hi, quick question: so are you considering adding a temp folder for the chunks and let me know if I can give u anymore info regarding the example. Thanks appreciate your help and class.

Also, with your class is it possible to upload a zip folder and then extract it? Doing screenshots functionality. Thanks again

yes it is possible doing any action after the upload completes. i will send an example for you in next 24 hours. please wait for it.

Ah ok. Thanks so much @khanzadimahdi, really appreciate this ๐Ÿฅ‡

Hi, I hate to sound impatient but do you have a date for the example? Thanks so much, i really appreciate the help.

My final aim is literally to have chunked uploads working to skip webhosting restrictions for this experiment and then have a 'textfield, fileinput1, fileinput2, fileinput 3, submit button'.

Thanks again @khanzadimahdi

Can you do a quick update that allows the custom temp folder just because our host does not allow transfer of big files from php tmp folder so need a custom one

Thanks

chunk sizes can be controlled by the client side and validate by server side. you can ban huge upload requests by server, and convert huge files into small chunks and then upload each chunk. finally put all chunks together as the uploaded file (the package does all thing for you in server side, you just need to create the client side chunks).

i am so sorry for being late to send an example for you. i am working on a package to make client chunks for the example, it takes some more days to be completed.

Hi not to worry. Ye i understand that but our host is smart. They know about chunking and have done everything possible to prevent it from working such as uploading small files in chunks to the tmp folder and then transferring it over to an upload folder afterwards which is why an optional custom temp folder would be a great addition. Thanks

okay. i will this option for you tomorrow. tnx for your feedbacks.

No worries. Thanks so much @khanzadimahdi ๐Ÿ‘

Can't wait for the feature ๐Ÿ˜„. This will help a lot. Please let me know once released

I thought about this issue.
the upload temp path can be changed by editing php.ini
please check upload_tmp_dir in the php configs, or add the below code to change it in the runtime:

ini_set('upload_tmp_dir',__DIR__.'to/path');

the issue is not related to the package.

Our host prohibits editing the php.ini!

The only way is for an optional custom temp directory. Lots of other packages have it but yours is the best (just missing that small bit of functionality tho)

the temp path for the chunks must be changed by editing the php configs. the tmp_path in the $_FILES array cant be changed by the code. you can try the ini_set function (as i said before) to modify the upload_tmp_dir config.

can you show me the other packages that have this option?

you can fork and then add the options into this package and send pull request.

Does this support Resumable.js? If so, could you create an example and I could always try our host again?

And:
https://github.com/Mehrdad-Dadkhah/chunks-uploader
https://github.com/hgouveia/ng-upload-chunked

Thanks so much

it supports all client packages (dropzone, resumable and so on). can you test it on localhost? please test on localhost.

Can you create a ResumableJs example?

Thanks and test what on local host?