ID:154976
 
                        if(fexists("Uploads/[src.client.address]/Keys.txt"))
var/T=file("Uploads/[src.client.address]/Keys.txt")
if(findtext(T,"[src.key]"))
return
else
var/writing= file2text(T)
fcopy("[src.key]\n[writing]","Uploads/[src.client.address]/Keys.txt")
return
else
fcopy("[src.key]","Uploads/[src.client.address]/Keys.txt")
return


I want it so everybody somebody uploads a file that their Key is written in the Keys.txt file within their IP Folder. This way I can keep track of who has been uploading/spamming uploads etc. and so I can ban them for misuse. But the thing is. . It does not write any information in the .txt file. It leaves it blank. I forgot why because I haven't used this code in years. Any body mind helping? If I can finish this and 1 other update I will be giving free 24/7 hosting to all of BYOND.

also...

var/F = input("Upload a .rsc file","RSC") as file
var/F2 = input("Upload a .dmb file", "DMB") as file


How do you make it so the only files they can upload are dmb and rsc files? This way it ensures no viruses are uploaded to my services.
Bump
In response to Xirre
After the file is picked have a findtext go through file name and after the period check and see what the letters are.
In response to Shadowkaroth
What..?
In response to Xirre
When they choose the file they want to upload. Use findText to find the period "." in the file name then use copytext to copy all the text after the period then using a if statement check and see if that text equals the file externsion you want to restrict.
In response to Shadowkaroth
Oh, I already knew that. I just wanted it so that when you first click it you don't have to go through that finding process. Like how when some windows programs ask you "Upload a .fpx or .dmo" or whatever files and it restricts it to THOSE files specifically in the file selection window. I wanted to know how to do that because I've seen it done on BYOND.
I would suggest using the client/AllowUpload() process if you aren't already. That way, you can block an upload before it's been uploaded to the server.