re upload file does not delete the old one for UploadToDir

Discuss MySQL Ajax Table Editor Pro Version

re upload file does not delete the old one for UploadToDir

Postby pq_rar » Tue Jan 27, 2015 7:24 pm

In the handleUpload function, deleting the file if the column already had one does not work.
If I spit out
Code: Select all
$this->Editor->warnings[] = $row["file_name"];
inside the
Code: Select all
if(strlen($row["file_name"]) > 0)
condition, it shows a blob string type of format, not the name of the file.
So, the following code won't work:
Code: Select all
unlink($this->dataDir.$row["file_name"]);


also there is a small syntax bug in the same function(valErrros see the 3 'r'):
Code: Select all
$valErrros[] = 'The file could not be moved';

side note: even if something goes wrong, I do not see the $valErrors beeing passed...probably minor
pq_rar
 
Posts: 89
Joined: Thu May 27, 2010 4:44 am

Re: re upload file does not delete the old one for UploadToD

Postby pq_rar » Mon Feb 09, 2015 10:06 pm

anybody? sample error:
error1.png
error1.png (53.72 KiB) Viewed 53343 times
pq_rar
 
Posts: 89
Joined: Thu May 27, 2010 4:44 am

Re: re upload file does not delete the old one for UploadToD

Postby Atara » Tue Jan 30, 2018 8:59 am

I get the same error. is there a fix?
Atara
 
Posts: 12
Joined: Wed Jul 26, 2017 9:01 am

Re: re upload file does not delete the old one for UploadToD

Postby mate_user » Wed Jul 28, 2021 3:37 pm

Hello,

I have the pro version and I cannot get an existing file to be deleted when a new file that replaces it is uploaded.

Clearly it's because the file name info is an object or something.. is there a decode function I can use to make the object the string name of the file?

Like instead of this:


Code: Select all
%PDF-1.3\r%????\r\n5 0 obj\r<</Linearized 1/L 14812/O 7/E 10879/N 1/T 14593/H [ 516 146]>>\rendobj\r                    \r\nxref\r\n5 11\r\n0000000016 00000 n\r\n0000000662 00000 n\r\n0000000722 00000 n\r\n0000000849 00000 n\r\n0000000933 00000 n\r\n0000000967 00000 n\r\n0000001):


I need it to be like this:

Code: Select all
filename.pdf


I have even tried a custom mysqli query to pull the text from the DB but the data is still an 'object'

Thanks!
mate_user
 
Posts: 8
Joined: Tue May 04, 2021 8:00 pm

Re: re upload file does not delete the old one for UploadToD

Postby mate_user » Mon Aug 09, 2021 6:25 pm

I ended up having to run a cron job to glob and unlink orphaned files against the DB table rows.

Not ideal but when support doesn't reply I guess it's all you can do. :(
mate_user
 
Posts: 8
Joined: Tue May 04, 2021 8:00 pm


Return to Pro Version

Who is online

Users browsing this forum: No registered users and 4 guests

cron