another question;
does anyone know the best way to determine the size of a file that's being uploaded via the html file input feild?
what i'm trying to do is limit the size of the pictures people can upload, but have no clue where to start, eg, the directoryinfo, binary*, etc, etc, so i want to ask someone with experience what they think the best method is to evaluate the size of a file in a pages _load/postback routine.
i already have the upload part working as far as simply uploading goes:
Code:
IF PAGE.IsPostBack THEN
DIM P13 AS String
IF (RIGHT(PIC.VALUE, 3)) = "jpg" THEN P13 = ".JPG"
IF (RIGHT(PIC.VALUE, 3)) = "JPG" THEN P13 = ".JPG"
IF (RIGHT(PIC.VALUE, 3)) = "gif" THEN P13 = ".GIF"
IF (RIGHT(PIC.VALUE, 3)) = "GIF" THEN P13 = ".GIF"
IF (RIGHT(PIC.VALUE, 3)) = "bmp" THEN P13 = ".BMP"
IF (RIGHT(PIC.VALUE, 3)) = "BMP" THEN P13 = ".BMP"
IF (RIGHT(PIC.VALUE, 3)) = "png" THEN P13 = ".PNG"
IF (RIGHT(PIC.VALUE, 3)) = "PNG" THEN P13 = ".PNG"
IF PIC.VALUE <> "" THEN
DIM CM2 AS OLEDBCOMMAND
DIM CN2 AS OLEDBConnection
DIM CMV2 AS String
CN2 = new OLEDBConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0;Data Source=Z:\WWW\DATA\MX.mdb")
CMV2 = "UPDATE PROFILE SET PIC" &NUM.TEXT & "='" &P13 &"' WHERE UNAME='" &UNAME.TEXT &"'"
CM2 = NEW OLEDBCOMMAND(CMV2,CN2)
cn2.open()
CM2.EXECUTENONQUERY()
CN2.Close
CN2 = NOTHING
Dim filepath As String
filepath = Path.Combine ("X:\www\profiles\USERS\" & UNAME.TEXT &"\", Path.GetFileName(DS222.Tables ("PROFILE").ROWS(0).ITEM(I).TOSTRING()))
If File.Exists(FilePath) Then
File.Delete(FilePath)
End IF
filepath = Path.Combine ("X:\www\profiles\USERS\" & UNAME.TEXT &"\", Path.GetFileName(NUM.TEXT & P13))
PIC.PostedFile.SaveAs(filepath)
END IF
RESPONSE.REDIRECT("PIC.ASPX?uname=" & UNAME.text)
END IF
i just need to figure out how to evaluate the file's size.
i tried to search this forum, and others for a good idea, but i guess this isn't that hot of a topic.
i don't really need a code example. if you could just tell me a good way to do it, i can look up the gory details myself, so it doesn't take too much of your time, but i'm not opposed to anyone offering further help.
thanks in advance: ALEX GRIM
---------------------------
A Black sheep moves easy in the darkness.
[email protected]
WWW.GRIMMUSIC.COM