Scheduled Maintenance: 10-11-2025 Electricity company maintenance between 09:00 and 15:00.

3.2 & 3.3 Extensions Database 3.2 / 3.3File Upload

<span class="qte-attr qte_32_33-qte">3.2.x & 3.3.x</span>
User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

Mmmm, sorry, maybe I'm missing something...
This extension is for FILES upload... (rar, zip, etc)... Not specifically for images...
And is in that way that I would like to use it (I need in my case to upload xml files, that will be updated from time to time locally and then uploaded everytime - so that's why I need the possibility to overwrite them).

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

TheFactor82 wrote: 01 Dec 2017, 14:13 Mmmm, sorry, maybe I'm missing something...
This extension is for FILES upload... (rar, zip, etc)... Not specifically for images...
And is in that way that I would like to use it (I need in my case to upload xml files, that will be updated from time to time locally and then uploaded everytime - so that's why I need the possibility to overwrite them).
Image upload and file upload are almost the same in code so they work the same with the name. :wink:

What you can try is this line:

https://github.com/dmzx/File-Upload/blo ... d.php#L222

change it to:

Code: Select all

'fileupload_realname'	=>  ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $upload_file->get('uploadname')))),
And upload a file.
Let me know if that solved your question :wink:

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

Thank you for your support!
It works exactly the opposite of what I need... :rolling:

Image

The first row shows how the original extension works.
The second row shows the result with you suggested mod.
I would like to obtain that FILE NAME and REAL FILE NAME are the same... But with readable name, not "generated" name :D

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

Changed post above File Upload

Let me know

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

Sorry for late reply...
It's not working like it should...
Currently in ACP shows for both real file name, and file name, the same "readable" name.
But in the FILES folder, the file is saved with the "generated" filename...
:wtf: :???:

User avatar

martin Online
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

If it looks like this image then its working perfect.
Selection_001.png
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
Image

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

No, it's works in this way:
on ACP I can see file names:
Image

(you can also see that file size is 0 bytes).

But in "files" folder, the file is uploaded with "generated" filename:
Image

What I need is that the file remains with original filename...

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

TheFactor82 wrote: 04 Dec 2017, 14:43 No, it's works in this way:
on ACP I can see file names:
Image

(you can also see that file size is 0 bytes).

But in "files" folder, the file is uploaded with "generated" filename:
Image

What I need is that the file remains with original filename...
will check this.

User avatar

martin Online
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

Taking into account phpbb renames things for security reasons :whistl:

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

martin wrote: 04 Dec 2017, 19:53 Taking into account phpbb renames things for security reasons :whistl:
So it means that it is not possible?? :sad:

User avatar

Topic Author
dmzx
Founder
Founder
Posts: 6469
Joined: 13 Jan 2014, 21:45
    Windows 10 Chrome

Re: File Upload

Post by dmzx »

TheFactor82 wrote: 05 Dec 2017, 15:25
martin wrote: 04 Dec 2017, 19:53 Taking into account phpbb renames things for security reasons :whistl:
So it means that it is not possible?? :sad:
No its possible but need to check the edits.

User avatar

martin Online
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

99% of things can be done but now think why files are encrypted :whistl:

I'l give you 2 reasons why NOT to have files in real names

1 I can upload a naughty zip on to your server now i know the path and file name so i can now call that file in the folder and have fun.
2 You upload a vip folder and now all non vip can all call the folder and help them self (if you know how too that is)

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

Sorry for that, but I don't get the point of what you are saying...
File-upload does NOT encrypt files. Simply, it renames them in order to avoid overwrites. In fact, you can normally rename the "40696abb215321ae78045a579c07a354.zip" or whatever to anything else, and you can still open it without any problem.
Also speaking about reasons of why it happens, I think that it is totally normal that a file is reachable on a server: when you use file-upload, it gives you exactly the path to the file... It's exactly what it's planned to do. If I share an url to a file uploaded with this extension, it's indifferent if it is the real filename or a generated filename...

Sorry if I'm missing something... And Thanks Dmzx for the time you are spending on this request!

User avatar

martin Online
Admin
Admin
Posts: 5106
Joined: 06 Apr 2014, 16:12
    Ubuntu Chrome

Re: File Upload

Post by martin »

Image

Dude i know how it works i'm the one who converted this ext from what it was.

User avatar

TheFactor82
Users
Users
Posts: 15
Joined: 17 Nov 2017, 14:42
    Windows 10 Chrome

Re: File Upload

Post by TheFactor82 »

Ehy, it was not my intention to be rude, I'm just trying to understand. :D

Post Reply Previous topicNext topic