CakePHP-AjaxMultiUpload icon indicating copy to clipboard operation
CakePHP-AjaxMultiUpload copied to clipboard

File parameter missing

Open jasonchua89 opened this issue 12 years ago • 18 comments

Hi there,

Thanks for this awesome plugin. However, I am having an issue with deleting some files. When I upload any file, it uploads properly but when deleting some files, it gives me "file parameter missing" but for other files, they delete fine. Not sure what the problem is. Eg. I uploaded two .png files that are of different file names, one of them deleted fine, the other raises the "file parameter missing" error.

Hope you can help me with this.

Thanks!

jasonchua89 avatar Aug 02 '12 05:08 jasonchua89

Hmmm, strange, I haven't seen this before. Do you notice anything specific about the files that can't be deleted? Spaces, special characters, etc? Anything odd about them? If you could send me a sample list of file names and which ones don't work, I can look into it and probably find out what happened.

srs81 avatar Aug 02 '12 14:08 srs81

I didnt notice anything specific about the files that can't be deleted. Not sure why they're behaving this way. Below is a sample list of the files that can and cannot be deleted.

Successful Delete: 3-Claytoncolour.pdf Database New.jpg timetable.pdf unit plan.pdf

Unsuccessful Delete: 3333-cl-bbis-2011.doc Issues List Description.doc Timetable Y3S1.jpg Y3S1 Exam Timetable.jpg jquery-ui-1.8.20.custom.zip qmanual.pdf Course Outline.jpg grid_timetable.xls Results.xlsx

jasonchua89 avatar Aug 02 '12 23:08 jasonchua89

Hi,

Have you had the chance of finding out what's causing the error? I still cant find what's wrong with it.

Cheers.

jasonchua89 avatar Aug 08 '12 13:08 jasonchua89

Yes, i got the same issue. It's only happening for the first file that i uploaded. The second and the rest of them are just fine

andranos avatar Aug 23 '12 02:08 andranos

It's happening for random files for me. Be it second, third or fourth file uploaded.

jasonchua89 avatar Aug 23 '12 04:08 jasonchua89

I'm not sure if it's related or not, my view.ctp and edit.ctp are inside the plug in folder as i'm using this plugin for another plugin. Because i tried this on my local machine where the view and edit files are located in the default folder (app/view/.../view.ctp) and it all works just fine... And yeah, it's happening for random files as well for me

andranos avatar Aug 23 '12 11:08 andranos

Anyone find anything about this problem?

andranos avatar Aug 27 '12 15:08 andranos

Still not working for me. Not sure what else I can do. Sorry. =( I hope the author replies soon with a solution....

jasonchua89 avatar Aug 27 '12 15:08 jasonchua89

Can you guys do me a favor. In this file /View/Helper/UploadHelper.php, replace lines 34-35 with this one line:

$str .= "<a href='$delUrl'>Delete $baseEncFile</a> ";

And let me know whether the baseEncFile is empty for any of the files that have a problem? It looks like its not base64 encoding properly.

srs81 avatar Aug 27 '12 17:08 srs81

Sorry. Could you be more specific as to which lines I have to replace?

lines 34-35 for me is: if ($edit) { $baseEncFile = base64_encode ($file);

jasonchua89 avatar Aug 28 '12 04:08 jasonchua89

It shows something like this Delete RDpcV2Vic2l0ZXNcaWVccHJvamVjdDA4XHBlbm55aGVhbHRoLXYyXGFwcFx3ZWJyb290XFxmaW so i'm guessing this means baseEncFile is not empty

andranos avatar Aug 28 '12 09:08 andranos

Hmmm, I think I know what is going on. Do you mind sharing the directory path that your files are on? That might have something to do with this. The root file directory might be too long, but I would like to confirm.

srs81 avatar Aug 28 '12 19:08 srs81

In the very first line of this plugin file: Controller/UploadsController.php, can you change is_null() to one of these two:

  1. (!isset($file))
  2. if ($file === null)

and see if that fixes the issue?

srs81 avatar Aug 28 '12 22:08 srs81

Yeah i think it's too long as well. This is the link ie.infotech.monash.edu.au/project08/pennyhealth-v2. Unfortunately, already tried those 2 codes but didn't fix the problem

andranos avatar Aug 28 '12 23:08 andranos

Well, it's getting worse, now i can't delete any file i uploaded lol. Hmm i don't know if this got something to do with it. Everytime i tried to upload a file, the "Failed" message keep appearing even though it's successful

andranos avatar Aug 28 '12 23:08 andranos

Hi srs81, I tried changing is_null to those two codes too. Still not working as well.

jasonchua89 avatar Aug 29 '12 05:08 jasonchua89

Jason , did you get the failed message as well when you uploaded a file? I got that for every files i uploaded

andranos avatar Aug 30 '12 05:08 andranos

Hmmm. No. It works fine for me. There's no failed message.

jasonchua89 avatar Aug 30 '12 06:08 jasonchua89