Author Topic: Uploaded by  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

Offline Foggy

  • Insane poster
  • *****
  • Posts: 806
    • View Profile
Uploaded by
« on: December 06, 2007, 04:15:48 AM »
Would it be possible to have a symbol %uploaded-by% that translates to the name of the user who uploaded it. I know that this wouldn't be possible until HFS3 because of real folders, but in the mean time would it be possible to have an option to automatically add a comment that says "uploaded by..." because comments work both with real folders and virtual folders.

Offline Mars

  • Operator
  • Insane poster
  • *****
  • Posts: 1788
  • Country: 00
    • View Profile
Re: Uploaded by
« Reply #1 on: December 06, 2007, 05:11:34 AM »
I, I shall look who makes what in the log ;D ;D ;)

More it would reveal which login is used for a specific resource.

Without wanting to discourage you the slightest of the world for this proposition. On the other hand, if it is for an internal usage it would be more sensible to write a log of success uploads in a file to part, it I think that it is possible more easily in first time.
And having Uploads message, you can choose what as information to put in this log file.

after you can  create section

[history]

{{load| uploads.log}}

and talk it by ~history
« Last Edit: December 06, 2007, 05:45:27 AM by mars »
FRENCH MEMBER : Si vous comprenez la langue française,  n'hésitez pas à l'utiliser pour une meilleure aide de ma part

Offline Foggy

  • Insane poster
  • *****
  • Posts: 806
    • View Profile
Re: Uploaded by
« Reply #2 on: December 07, 2007, 02:15:40 AM »
I think I understand what you are saying mars and that is a good idea about logging successful uploads but what I was trying to say was have a symbol %uploaded-by% that you can use in [file] and [folder] that would translate to the name of who uploaded it.

for example
Name: %item-name% Uploaded By: %uploaded-by%
which could translate to
Name: archive.zip Uploaded By: Foggy

Offline bacter

  • Operator
  • Insane poster
  • *****
  • Posts: 682
    • View Profile
Re: Uploaded by
« Reply #3 on: December 07, 2007, 05:08:56 AM »
I think %uploaded-by% would be too special.

In theory, it could be interesting to input comments when uploading files (example comments: for foggy 'uploaded by Auser', but also 'to use this program you need to install Something' ..)

But there will be some small big-problem:
The folders where you upload, have to be real folders, and there is no way to add comments for real objects to the vfs. So comments for real objects should be in a second file, something like uploaded.file.comment. So the first step would be to write such a comment-file on the users disk to be able to upload it. As with html & javascript there is no straight way to write a file to disk, the user must execute some program to create a comment.file. And that is from my potnt of view to complicated for normal users, so we have to wait at least for HFS3 with php.

But perhaps we could do something meanwhile: there are some interesting tasks that could be done on serverside with an external program, that will take his input from logged events. Such external programs are very easy to write as they don't need to use anything from hfs source. If it's fully external, the only thing such a program has to do, is to read the logfile when a new event is added, parse the log-line to separate the values, then with simple functions you can do what you need:
- ban users that try to login more than n times in m minutes without success
- write a foggy upload comment
- move uploaded files from an upload folder to another folder (if you want that users don't see new uploaded files after n seconds)
- create an account and send a confirmation to the user
- create thumbnails for new image files
- create or delete (real) folders IN a real folder.
- delete files
- .. etc
I haven't already tested it, but it seems that the only thing needed to let hfs know that we change something in the .ini file (bans, accounts) is to use the hfs -a option.
If we do something like that we could surely ask rejetto to add two things to hfs to make it even simpler: Add a command line option -r (reload .ini) and 'use external enhancement: filename' in the options menu, that would invoke the external program with every new logline as commandline parameter.

There is in my plans to write such an extension starting end of january. I would probably do it in C, but I'm also considering to refresh my pascal/modula and use delphi, perhaps knowing what languages are known withhin posters that would uses such an artifact.




your computer has no brain - use your own !

Offline Foggy

  • Insane poster
  • *****
  • Posts: 806
    • View Profile
Re: Uploaded by
« Reply #4 on: December 07, 2007, 07:36:05 AM »
What you suggest bacter is good, and I understand what you are saying but wouldnt hfs be able to create the uploaded.file.comment file quite easily. I know its quite a bad work around until HFS3 but it would get the job done, and I cant see any downside to it because if someone uploaded a file it would say who uploaded it and if the hfs administrator wants to then add a comment they can.

Thinking about comments and the such, I had the though of why not have a text field on the upload page that will upload a comment to hfs with the file, and hfs then create the comment file. I know you could manually upload a comment file but that could be abused and someone could upload a comment overwriting an old comment or adding an unneeded comment. At least this way no one can abuse the comments and people can still add comments for the files they upload.

If the idea of the text field for comments happens you could easily write some javascript that appends uploaded by to the end of the text field so the other idea isn't necessary.

Offline .:ʕΘЯgAnʔ:.™

  • Occasional poster
  • *
  • Posts: 6
    • View Profile
Re: Uploaded by
« Reply #5 on: December 07, 2007, 10:52:44 AM »
Thats a good idea

If someone uploaded something that was not cool at all aka illegal or just nasty
you know who to ban  ;)

Offline bacter

  • Operator
  • Insane poster
  • *****
  • Posts: 682
    • View Profile
Re: Uploaded by
« Reply #6 on: December 07, 2007, 11:28:36 AM »
Foggy:

The automatic 'uploaded-by-user' filename.ext.comment probably could be done in hfs without much progrramming effort, but it would require one menu other options option more that allows doing it or not.

About adding some comment with javascript like adding ?comment="whatever you want to add" when uploading a file, i have no idea if this can be done with the html-upload-request. If this were possible, then we could have the textfield in the upload form.

.. Organ ??:

To know who uploaded a file you dont need any comment, just log to file! There you can have registered when who did do what.
your computer has no brain - use your own !

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12832
  • Country: it
    • View Profile
Re: Uploaded by
« Reply #7 on: December 07, 2007, 11:02:33 PM »
i think that this can already be done in the last beta by using {{append}} but i still have to check.
you should add a line after [upload-success] like
{{append|PATH%item-name%.comment|uploaded by %user%}}

the point is the PATH thing. It is the real folder path on disk. Maybe this is not available yet. If not, i will add it.
Please, experiment ;)

Offline Foggy

  • Insane poster
  • *****
  • Posts: 806
    • View Profile
Re: Uploaded by
« Reply #8 on: December 08, 2007, 12:05:14 AM »
Ill have a try and see how it turns out, the macros save the day again :P

Guest

  • Guest
Re: Uploaded by
« Reply #9 on: December 10, 2007, 12:02:25 PM »
{{append|PATH%item-name%.comment|uploaded by %user%}}
Works great here !

Offline Mars

  • Operator
  • Insane poster
  • *****
  • Posts: 1788
  • Country: 00
    • View Profile
Re: Uploaded by
« Reply #10 on: December 10, 2007, 12:10:23 PM »
 
Quote
The automatic 'uploaded-by-user' filename.ext.comment probably could be done in hfs without much progrramming effort,

three possibility to see if a file is added in hfs list

- one user make an upload into a folder :  {{append|PATH%item-name%.comment|uploaded by %user%}}


- administrator add a folder or file in the hfs tree  : hfs can detect this

- look at the notification when a real folder is modified : there is delphi code for that ( i think possibility to detect if file is new)
« Last Edit: December 11, 2007, 03:13:00 AM by mars »
FRENCH MEMBER : Si vous comprenez la langue française,  n'hésitez pas à l'utiliser pour une meilleure aide de ma part

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12832
  • Country: it
    • View Profile
Re: Uploaded by
« Reply #11 on: December 10, 2007, 07:21:36 PM »
three possibility to see if a file is added in hfs list

it seems like this is not related to the topic

Matte

  • Guest
Re: Uploaded by
« Reply #12 on: December 16, 2007, 09:42:35 AM »
{{append|PATH%item-name%.comment|uploaded by %user%}}
Works great here !
Could you please explain how did you do it?
Should I see a comment under the uploaded file?

I've added the precise line right under [upload-success] but I don't see anything...

Guest

  • Guest
Re: Uploaded by
« Reply #13 on: December 16, 2007, 10:59:10 AM »
It works with HFS build 163. Not sure how far back it goes.
{{append|C:\your upload folder\%item-name%.comment|Uploaded By %user%}}
This creates a .comment file in the folder which shows comment with the uploaded
file. There cannot be a space between "folder\ %item-name%" or it wont work.

Offline rejetto

  • Administrator
  • Insane programmer
  • *
  • Posts: 12832
  • Country: it
    • View Profile
Re: Uploaded by
« Reply #14 on: December 17, 2007, 10:23:30 AM »
next beta will automatically log the user in comments,
so just wait for it :)