Alright i know this sounds really complicate, but please be patient as i'm trying to explain. I'm on a asp project (JScript, not VBScript) and i want to take advantage of its file upload feature. Naturally i'm using asp connector. My asp project is about a news website. I want every articles have their own folder on the server to store its medias like image, flash etc and i achieved this this way:
First Declare a session variable to store the folder name. This way once a user is accessing the editing page for a article, this session variable will hold the value of the article's id (an SQL 2K uniqueidentifier string such as 2BC2A09C-4DA1-436F-9929-340FCF13F816) for the folder name( Say i want to store all this on folder named Storage, then the location would be Storage/2BC2A09C-4DA1-436F-9929-340FCF13F816)
Second, in config.asp file for the connector, i edited the ConfigUserFilesPath variable like this:
ConfigUserFilesPath = "Storage/" + CStr(Session("FilesPath"))
Up to this point, everything is fine if we're editing an existing article. But the problem arise with new article: since the new article hasn't been created yet, we cannot have its ID for this Session variable. Therefore firstly the article must be created BEFORE the users could be able to access the file upload functionality.
My question is, how can we temporally disable the file upload function? I tried this by an another session variable, with this piece of code, but it doesn't seem to work:
Dim ConfigIsEnabled
If (CInt(Session("UploadEnable")) = 0) Then
ConfigIsEnabled = False
Else ConfigIsEnabled = True
End If
Any help would be great appreciated.
Regard,
NVT
First Declare a session variable to store the folder name. This way once a user is accessing the editing page for a article, this session variable will hold the value of the article's id (an SQL 2K uniqueidentifier string such as 2BC2A09C-4DA1-436F-9929-340FCF13F816) for the folder name( Say i want to store all this on folder named Storage, then the location would be Storage/2BC2A09C-4DA1-436F-9929-340FCF13F816)
Second, in config.asp file for the connector, i edited the ConfigUserFilesPath variable like this:
ConfigUserFilesPath = "Storage/" + CStr(Session("FilesPath"))
Up to this point, everything is fine if we're editing an existing article. But the problem arise with new article: since the new article hasn't been created yet, we cannot have its ID for this Session variable. Therefore firstly the article must be created BEFORE the users could be able to access the file upload functionality.
My question is, how can we temporally disable the file upload function? I tried this by an another session variable, with this piece of code, but it doesn't seem to work:
Dim ConfigIsEnabled
If (CInt(Session("UploadEnable")) = 0) Then
ConfigIsEnabled = False
Else ConfigIsEnabled = True
End If
Any help would be great appreciated.
Regard,
NVT