wooikeim
-
Posts
21 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by wooikeim
-
-
Oh, I'm so sorry, didnt see that statement. Anyway, i have put it in the next line, but then got another error.Dim downloadFile As System.IO.FileStream = New System.IO.FileStream(filename, IO.FileMode.Open) <Access denied >error msg- To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.I had follow that instruction but still cant work
-
You refer my code above, Response.Write(downloadFile.Length() & "#") is already there. So whats the problem
-
sub Datagrid1_ItemCommand (sender as object, e as DataGridCommandEventArgs) if (e.CommandName= "Download") then Response.ContentType = "application\octet-stream" Dim filename as string=new string("C:\Inetpub\wwwroot\tution\doc") Dim downloadFile As System.IO.FileStream = New System.IO.FileStream(filename, IO.FileMode.Open) Response.Write(downloadFile.Length() & "#") downloadFile.Close() Response.WriteFile(filename) Response.Flush() Response.End()I got the problem in downloading a file, it show me End of statement expected. i not sure my code correct or not. please kindly tell me what happen here. thanks......this line is highlighted <Dim downloadFile As System.IO.FileStream = New System.IO.FileStream(filename, IO.FileMode.Open) >
-
Where is the tutorial? do you mind give me the link so that i can redirect there. thkshere is a very basic tutorial (it is in PHP but the same concepts apply to ASP). The threads are not divided into categories like this forum but this should give oyu a good start. -
Hello, can you explain more detail? I not really understand the flow. A bit blur here.In my situation, after i successful login then the forum should in the main pageQuestion1)why need topic_id, reply_id, reply_content?2) The topic_name in the forum should put in hypperlink or what?3) How could i retrieve the topic name from the database and display in the system?
-
New window
in .NET
Hi, i not sure whether this in tutorial or not but i couldn't find it. I want to know how to open new wndow after i click on the link. If i use response.redirect("xxx.aspx") it will open the page in parent. In VBscript pls. thks
-
Oh thank you very much, it work after i use "postedFile.SaveAs(savePath & "\" & filename)" , thank a lot man.and also thanks to aspnetguy,jesh,pulpfiction.i been doing this for whole day I am newbie in .netIf "file" (or "files") is a directory, you can't save a file with that path. What you can do is save a file in that directory.You are still running:postedFile.SaveAs(savePath)
Rather than
postedFile.SaveAs(savePath & "\" & filename)
-
Well, it still the same, don't know what happen there. i had try debug it by putting this and it successful store in database, but the file cant save in the location(C:\Inetpub\wwwroot\tution\file).Dim savePath As String = "C:\Inetpub\wwwroot\tution\file" Try Dim postedFile = uploadedFile.PostedFile Dim filename As String = System.IO.Path.GetFileName(postedFile.FileName) Dim contentType As String = postedFile.ContentType Dim contentLength As Integer = postedFile.ContentLength Dim myConnection As SqlConnection = New SqlConnection("server=(local);database = MegaArif; trusted_connection= yes") Dim mycommand as sqlCommand= new sqlCommand("insert into notes(content, subject_id) values('"& FileName &"', '"& lblsubjectid.text &"') ",myConnection) mycommand.connection.open() mycommand.executeNonQuery() mycommand.connection.close() postedFile.SaveAs(savePath) message.Text = "uploaded" Catch exc As Exception message.Text = "uploade failed <br/><br/>" & exc.MessageEnd TryEnd SubI had also try another way, reference from http://www.superdotnet.com/Article.aspx?ArticleID=26Another error msg when i use the method.(Exception has been thrown by the target of an invocation)
-
Dim mycommand As SqlCommand = new SqlCommand("query",myConnection)is "query" fix? or what?instead do the followingDim mycommand As SqlCommand = new SqlCommand("query",myConnection)myConnection.Open()Dim dr As SqlDataReader = mycommand.ExecuteReader()While dr.Read lblsubject_id.Text = dr.Item("ColumnName")End Whiledr.Close()myConnection.Close()
-
well yes..did you try it for "Everyone" ? -
Well, i had try to put it as full control, but still the same.okay so you applied that tot he "files" folder? Try checking the "Full Control" option for ASPNET. If that doesn't work apply "Full Control" tot he Everyone account for that folder. This is not recommended as it leaves your system open but we will do it just to see if the error is indeed permissions releated. -
I had make a connection to the database. What i want now is to display the subject id in a label called lblsubject_id.--------------------------------------------------------------------------------------------------------------------------------------------------Dim mycommand as sqlDataAdapter= new sqlDataAdapter("Select subject_id from tutor where tutor_id = '"& lbluser.text &"' ", myConnection)b4 this what i do is show in datagrid, but now i want it to be display in label. Dim ds as new dataset() mycommand.fill(ds,"tutor") DataGrid1.datasource=ds.tables("tutor").defaultview Datagrid1.databind()what shud i do here?
-
(=_=") I had clear the Use simple file sharing. And created ASPNET(machinename/ASPNET) Modify option is checked, but it still show me Access to the path "C:\Inetpub\wwwroot\tution\files" is denied. I really get Frustrated......The default setting for the file system is "simple" file sharing. This does not show the security tab. Follow the article below to disable simple file sharing and the security tab will be visible.http://support.microsoft.com/kb/307874 -
You say about:-"Right click the target folder and choose Properties.Switch to the Security tab.If the ASPNET user is not shown in the list, add it.Click on the ASPNET user account and make sure that the Modify option is checked."I can't find security tab at all?only got General, sharing, web sharing and customize.sorry for disturbing.
-
I am using window XP.so?
-
beside "uploaded fail" it show me --> Access to the path "C:\Inetpub\wwwroot\tution\files" is denied. so may i know what is the solution?do this so we can get the real error messageSub Upload_Click(source As Object, e As EventArgs)Dim savePath As String = "C:\Inetpub\wwwroot\tution\files"TryDim postedFile = uploadedFile.PostedFileDim filename As String = System.IO.Path.GetFileName(postedFile.FileName)Dim contentType As String = postedFile.ContentTypeDim contentLength As Integer = postedFile.ContentLengthpostedFile.SaveAs(savePath)message.Text = "uploaded"Catch exc As Exceptionmessage.Text = "uploade failed<br/><br/>" & exc.MessageEnd TryEnd Sub
It is probably because the ASP.NET worker account does not have permission to write to the target folder.
-
I have a problem uploading file, even though the file is brose and when i click on upload then it always show me "uploade failed"can anyone find out where is my mistake? thank youSub Upload_Click(source As Object, e As EventArgs)Dim savePath As String = "C:\Inetpub\wwwroot\tution\files" Try Dim postedFile = uploadedFile.PostedFile Dim filename As String = System.IO.Path.GetFileName(postedFile.FileName) Dim contentType As String = postedFile.ContentType Dim contentLength As Integer = postedFile.ContentLength postedFile.SaveAs(savePath) message.Text = "uploaded" Catch exc As Exception message.Text = "uploade failed" End Try End Sub
-
I'll try on it first, any problem will let you know. thankswell you need to design some tables for your database.topics-------------topicIdtopicNametopicContentuserIdreplies-------------replyIdtopicIdreplyContentuserIdusers--------------userIduserNamepasswordthat is a very basic structure for a simple message board system. -
Yes, no problem read and write from database. just learn .net last monthDo you know how to read and write from a database? -
Hello, I'm currently developing an e-learning site which contain students, tutors and admin. i need a simple forum that just can post new topic, reply on topic, where integrate in each of their page. can anyone kindly tell me what to do? i'm stuck, well i'm just a beginner.
Downloading error
in .NET
Posted
No Solution for this? Or anyone got any code for downloading in .Net vbscript?