Upload specifics ASP.NET

Mitchsnitchel

Active Member
Joined
Jul 14, 2009
Messages
32
Reaction score
0
Ok so no one helped me on my last topic (http://mybroadband.co.za/vb/showthread.php/270243-ASP.net-database-connection-problems - thanks alot) but I figured it out and the databases are working perfectly now.

My next problem is the elements within the "HTML input(file)" control. Here is what I have:

Dim file as string = session("Username").Tostring + ful.filename

try
ful.SaveAs(Server.MapPath("Uploads/" + file)

... and so on

At the moment files are uploaded to locally.
where would server ip, username and password be placed in that line and in what context? ANY help would be appreciated

cheerio
 
Ok so no one helped me on my last topic (http://mybroadband.co.za/vb/showthread.php/270243-ASP.net-database-connection-problems - thanks alot) but I figured it out and the databases are working perfectly now.

My next problem is the elements within the "HTML input(file)" control. Here is what I have:

Dim file as string = session("Username").Tostring + ful.filename

try
ful.SaveAs(Server.MapPath("Uploads/" + file)

... and so on

At the moment files are uploaded to locally.
where would server ip, username and password be placed in that line and in what context? ANY help would be appreciated

cheerio

:sick:
 
the user profile used to perform the upload should have permissions on the various sub-dirs within the web application folder...
therefore, surely you could use a Server.Mappath("\directoryname\") in order to upload.... you should not really require an IP, user or pass for this....

make sense???

am I misunderstanding the problem???
 
Thanks for reply
I think you understand fully.
However I do not. I wanna know how the selected file for uploads knows how to make it to a directory on server side just by adding Server.MapPath?
Sorry for the nubness, but thats what forums are for :P
 
Your HTML page must have a control of type file:
<input type="file" name="file" size="40">
The browser will deal with this type of input control by establishing a stream to the server, the browser then feeds the stream the data contained in that file, your job is to catch that stream and save it somewhere.
There are alternates to the file input control that use Javascript, but the principal is the same.
You can google for Server.MapPath's functionality.
 
Mitchsnitchel said:
I think you understand fully.
However I do not.

ROFL

Mitchsnitchell said:
You are not very helpfull

Actually it is quite helpful. Understandable if your course requires you to code in VB.NET but where possible use C# as the job market is greater for these skills. Obviously these are just two different languages, the framework remains the same but the difference between VB.NET and C# grows with every new release. I don't know where Microsoft officially stands on the future of these two languages but I'm quite sure C# is where they are maintaining their focus.
 
Last edited:
hey Mitch.... did you come right or do you still require some help??
 
Top
Sign up to the MyBroadband newsletter
X