rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: pcs800 on March 07, 2006, 02:44:48 AM

Title: file types
Post 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?
Title: file types
Post by: rejetto on March 07, 2006, 10:42:29 AM
yes, it was already asked, try searching the forum.
the solution is editing the template, because it is a feature of html language.
Title: re
Post by: pcs800 on March 07, 2006, 01:05:08 PM
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.
Title: re
Post by: pcs800 on March 07, 2006, 01:49:04 PM
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>
Title: file types
Post by: rejetto on March 07, 2006, 03:21:50 PM
try consulting an html reference
Title: re
Post by: pcs800 on March 08, 2006, 01:38:38 AM
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?
Title: file types
Post by: rejetto on March 08, 2006, 02:00:53 AM
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.
Title: re
Post by: pcs800 on March 08, 2006, 04:06:50 AM
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?
Title: Re: re
Post by: rejetto on March 08, 2006, 05:34:16 AM
Quote from: "pcs800"
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

Quote
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. :)
Title: re
Post by: pcs800 on March 08, 2006, 01:07:35 PM
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.
Title: re
Post by: pcs800 on March 21, 2006, 02:36:52 AM
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?
Title: file types
Post by: rejetto on March 21, 2006, 08:21:56 AM
yes, i noticed it
this is a bad compliance of browsers to html
i don't know any solution ATM
Title: re
Post by: pcs800 on March 21, 2006, 01:09:25 PM
So this means there is no way with this software to specify file type that can be uploaded?
Title: file types
Post by: rejetto on March 21, 2006, 01:35:52 PM
maybe using javascript, inside the template
Title: re
Post by: pcs800 on March 21, 2006, 03:44:53 PM
Javascript? I did not know of a script that could limit uploads to certain file extensions.
Do you?
Title: file types
Post by: rejetto on March 21, 2006, 03:51:46 PM
i think you can make an onSubmit checking the content of the input, and return true only if the extention is ok
Title: re
Post by: pcs800 on March 21, 2006, 07:53:06 PM
I am not familiar enough with scripting to do create something like that. I guess this software is for programmers.
Title: Found a solution
Post by: teslaman on May 11, 2006, 12:19:30 PM
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 ;)
Title: re
Post by: pcs800 on May 11, 2006, 12:46:29 PM
Thanks for the info, I have since found another app that suits my needs better.