rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: pcs800 on March 07, 2006, 02:44:48 AM
-
Is there a way to specify only certain file extension that can be uploaded by users?
-
yes, it was already asked, try searching the forum.
the solution is editing the template, because it is a feature of html language.
-
I did search, I can't seem to find anything, or i get 100 results.
Where is the template? I see nothing accept the exe file.
-
Found this but it does not make any difference. I can still upload other file types.
you should edit the template
search for
Quote:
[upload-file]
<input name=fileupload%idx% size=70 type=file><br>
replace with
Quote:
[upload-file]
<input name=fileupload%idx% size=70 type=file accept='application/zip,application/rar'><br>
-
try consulting an html reference
-
I am quite fluent with html, but the changes i made did not solve the issue. i would much rather use hfs than some php script, i am not trying to be difficult, i just don't see the problem with the changes i made.
Is there another line that needs to be changed along with that line?
-
well, i never did, just had a look at the html reference and reported.
if it doesn't work, maybe it is browser's fault.
you could check other browsers, or find information about compliance of yours.
keep in mind that HTTP is request/reply. if even you ask me to filter out files, HFS has to receive the whole file before discarding. it is much better to avoid the client uploading by acting on the template.
-
Ok, so you are saying that if someone tried to upload a 2GB file that was not in my list of ok file types, it would upload and then get deleted?
In any case, i really like the app and want to use it for this purpose.
Any chance you would take a donation in exchange for custom code on the template?
-
Ok, so you are saying that if someone tried to upload a 2GB file that was not in my list of ok file types, it would upload and then get deleted?
for server-side filtering, as i depicted, yes
Any chance you would take a donation in exchange for custom code on the template?
it depends, try making a more precise request.
and...since it is opensource, anyone can do the work, not just me. :)
-
Ok, I just need the template to allow 4 types of extensions to be uploaded. That's it.
I will look around for code help on this, thanks anyway.
-
Ok I changed this
[upload-file]
<input name=fileupload%idx% size=70 type=file><br>
To this
[upload-file]
<input name=fileupload%idx% size=70 type=file accept='application/zip,application/rar'><br>
And was still able to upload any file type i want.
What is the deal?
-
yes, i noticed it
this is a bad compliance of browsers to html
i don't know any solution ATM
-
So this means there is no way with this software to specify file type that can be uploaded?
-
maybe using javascript, inside the template
-
Javascript? I did not know of a script that could limit uploads to certain file extensions.
Do you?
-
i think you can make an onSubmit checking the content of the input, and return true only if the extention is ok
-
I am not familiar enough with scripting to do create something like that. I guess this software is for programmers.
-
I wanted to do the same thing and have found a solution that will work. Download the program here: http://dl.ntworks.net/DLMov_11.rar posted by Yves @ http://www.rejetto.com/forum/viewtopic.php?t=3017
Then you can set it up how you want, but basically add the extensions you don't want and set the path to C:\RECYCLER In Win XP you will have to open a folder (or use Folder Options in the control panel) and go to Tools/Folder Options/View/ and check "show hidden files and folders" and uncheck "Hide protected operating system files". That way you can see and set the folder. Afterwards you can hide it all again.
Ex: of what I did as a test
1. Ext= html ; location= C:\Keep
2. Ext= * ; location= C:\Recycler
That way it moved the html file to my keep folder and then moved all other extensions to the recycle bin. And I have my recycle bin set up to not use it, ie auto delete and not to display confirm box. So anything else besides an html file is gone.
Hope this helps ;)
-
Thanks for the info, I have since found another app that suits my needs better.