473,503 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem using Input file

Hi!

I have a problem using the input file, what I want to do is either send the
file with an attachment or upload it on the server. When I do my test on my
PC everything is OK but when I put it on the server everything fail. We open
permission, we did a lot of things but it still doesn't do it. We don't have
errors. Is anyone have a solution?
Thanks Joel :)

Here the code with the filesaveas;
Dim strFilename As String
Try
' Get the file name.
strFilename = filUpload.PostedFile.FileName
If filUpload.PostedFile.ContentLength = 0 Then
Else

' Get the base name for the file (exclude path).
strFilename = System.IO.Path.GetFileName(strFilename)
' Save uploaded file to server.
filUpload.PostedFile.SaveAs("\\www.ubishops.ca\upl oadfiles\" & strFilename)
'I ALSO TRIED IT WITH THIS Server.MapPath("./uploadfiles") & "/"

End If
Catch ex As System.UnauthorizedAccessException
Me.TextBox1.Text = "You must set the permissions on the server to allow the
ASPNET user to write to the destination folder."
Catch ex As Exception
Me.TextBox1.Text = "An unexpected error occurred: " & ex.Message
Finally
End Try

'MAIL ATTACHMENT CODE
Dim msg As New MailMessage
With msg
..From = Me.mmlblClient.Text + "@SERVER"
..To = "MAIL@MAIL"
..Subject = "HelpDesk Service Request"
If filUpload.PostedFile.ContentLength = 0 Then
Else
'dim atcItem As New MailAttachment(Request.MapPath("./uploadfiles") '& _
'"\" & strFilename)

Dim atcItem As New MailAttachment(strFilename)
..Attachments.Add(atcItem)
End If
..Body = "ITS PrintShop Request#"
'Me.txtDescription.Text
End With
'msg.Attachments.Add(llist)
SmtpMail.SmtpServer = "SERVER"
SmtpMail.Send(msg)
Nov 19 '05 #1
0 1092

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5213
by: dbuser | last post by:
Hi, I need help on a problem, as described below. I am reading a file "input.txt"which has data like this: abc def gh izk lmnopq rst uvwxyz I am using fstream object to read the file and...
8
15344
by: Brady | last post by:
Hi, I'm having a problem reading and writing to a file. What I'm trying to do is read a file, modify the portion of the file that I just read, and then write the modified data back to the same...
0
3910
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
5
8602
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
0
1993
by: deacon57 | last post by:
FYI - If you are a computer scientist (or geek), this post may be for you. I wanted to log any search keywords, etc that are used on my site. I created a simple program that logs search terms...
0
2011
by: raa abdullah | last post by:
Overview A conflict-serializbility\recoverability checker, SCR, is a program that takes in a schedule and outputs 2 decisions: Conflict serialzable or Not confilict serializable AND Recoverable or...
12
5807
by: NOO Recursion | last post by:
Hi everyone! I am trying to write a program that will search a 12x12 for a thing called a "blob". A blob in the grid is made up of asterisks. A blob contains at least one asterisk. If an...
12
3381
by: Julian | last post by:
Hi, I am having problems with a function that I have been using in my program to read sentences from a 'command file' and parse them into commands. the surprising thing is that the program works...
10
1882
by: strife | last post by:
Hey everyone, I was making a program for a class, and I ran into a problem that is driving me crazy. I first suspected Vista, and since I am not home I cannot verify if it just my Vista...
4
2929
by: liberty1 | last post by:
Hi everyone. I appreciate your effort at helping newbies like me. I have the following problems and will appreciate urgent help. PROBLEM NUMBER 1: Using PHP and MySQL, I am able to upload...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7006
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4685
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
397
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.