ID:165840
 
is there a way to check file size on something? like if you do
input(" ")as icon
can u run a thing to check how large the file is before allowing them to upload it? you know! to prevent lag and stuff from huge files getting uplaoded
Nope -- You could use '<code>length(file)</code>' to check the size after the uploading, though.
In response to DivineO'peanut (#1)
mob
verb
Size(F as file)
src<<"The size of [F] is [length(F)] bytes"


This is the file size not its size on disk.
In response to Xx Dark Wizard xX (#2)
That wouldn't check the size before uploaded, but after.
In response to DivineO'peanut (#3)
mob
verb
UpLoad(I as icon)
if(length(I)>=1024000)
src<<"file is to big"
else
I = fcopy_rsc("[I].dmi")


It is possible.
In response to Xx Dark Wizard xX (#4)
Again, that would first upload the icon, then check the length.
In response to DivineO'peanut (#5)
Maybe we should get a size_of type operator. To do this.
In response to Xx Dark Wizard xX (#6)
Xx Dark Wizard xX wrote:
Maybe we should get a size_of type operator. To do this.

I already suggested having the client send the size of the files before sending it, but it was put low on the list of priorities (or not at all) because the client has pretty much no processing of it's own: the server does all the work, and the client can't be trusted much with sending the size, since this can be forged. (Or something. Help!)
In response to Xx Dark Wizard xX (#6)
Xx Dark Wizard xX wrote:
Maybe we should get a size_of type operator. To do this.

It wouldn't change things; processing in BYOND is done server-side. Because of this, processing to determine the file size requires the server having the file in question to process, which requires the file having been uploaded to the server in the first place.

Hiead
In response to Hiead (#8)
Hiead wrote:
Xx Dark Wizard xX wrote:
Maybe we should get a size_of type operator. To do this.

It wouldn't change things; processing in BYOND is done server-side. Because of this, processing to determine the file size requires the server having the file in question to process, which requires the file having been uploaded to the server in the first place.

Hiead

*COUGH* *points up*
Ripper! >_<
In response to Android Data (#9)
Android Data wrote:
*COUGH* *points up*
Ripper! >_<

I started typing before you posted. :P

Hiead
In response to Hiead (#10)
Hiead wrote:
I started typing before you posted. :P

Hiead

*COUGH* *points to Hiead*
Liar! >_<
In response to Android Data (#11)
Stealing lines from Naruto eh?

Don't we all love to digress? :)

- GhostAnime
In response to GhostAnime (#12)
GhostAnime wrote:
Stealing lines from Naruto eh?

Don't we all love to digress? :)

- GhostAnime

Wtf? I haven't watched a single episode of Naruto, and I have no idea what it really is. All I know is that you can turn into a tree or something.
In response to Android Data (#13)
Oh, well, don't worry about it >_> But if you want to know:

The teacher of Naruto, Kakashi, always comes late, even to appointments that he makes. When he arrives at the team meeting, he makes up some bul...er, crazy story than Naruto and Sakura points at him and shouts out LIAR!..Err, I think that's how it usually goes...

But who really cares? Not me.

- GhostAnime
In response to GhostAnime (#14)
!HALT!
This post has exceeded it's total amount of pointless chatter. A BYOND Forum Moderator will now come by to delete some of the posts, or these posts will be preserved for useless archivation.

Thank you for using the BYOND Forums(TM).

<small>(Data out.)</small>
In response to Android Data (#15)
lol @ backseat moderating