asp.net file upload not working

I have an asp.net website I created in VS 2010.  One of the pages is a file upload, when I run it on my local machine it can upload documents up to the server just fine.  When I publish it to that server and I try to upload a document it gives me a generic

ERROR: Logon failure: unknown user name or bad password

I have given the folder I am trying to upload to access by Everyone and it still doesn't work.  Any ideas?
martyuniAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

martyuniAuthor Commented:
Tried as many of the things that i could in there and still getting the error.
0
nmarunCommented:
You might then want to share some code and experts here will have a look at it.
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

martyuniAuthor Commented:
<table>
             <tr>
                <td class="style1">Job PDF:</td>
                <td><asp:FileUpload ID="FileUpload1" runat="server" /></td>
            </tr>
             <tr>
                <td colspan="2" class="style2"><asp:Label ID="Label1" runat="server"></asp:Label>
                 <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                    </asp:ToolkitScriptManager></td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="Button1" runat="server" Text="Button" /></td>
            </tr>
        </table>

Code behind:

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        If FileUpload1.HasFile Then
            Try
                FileUpload1.SaveAs("\\myServer\job_uploads$\" & FileUpload1.FileName)

                Response.Redirect("default.aspx")
            Catch ex As Exception
                Label1.Text = "ERROR: " & ex.Message.ToString()
            End Try
        Else
            Label1.Text = "You have not specified a file."
        End If
    End Sub


Page loads, browse to file and get: ERROR: Logon failure: unknown user name or bad password
0
masterpassCommented:
make sure you have given access in folder "job_upload" to the ASP.NET, NETWORK and NETWORK SERVICE accounts ..

If still your problem persists, add impersonation to true

<system.web>
<identity impersonate="true" userName="mydomain\myusername"
password="mypassword" />
0
martyuniAuthor Commented:
I have all 3 of those accounts with access to that folder.  Still didn't work.  Added the impersonate and tried multiple accounts including a domain admin account and it still didn't work.  

Still unsure why it works on my local machine to that share but once it gets on the iis box it stops working.
0
masterpassCommented:
Is the share folder "job_uploads" in the same server or different server ?
0
drypzCommented:
Hi! You may try this one.

FileUpload1.SaveAs( Server.MapPath(".")  + \job_uploads$\" & FileUpload1.FileName)
0
drypzCommented:
FileUpload1.SaveAs( Server.MapPath(".")  + " \job_uploads$\" & FileUpload1.FileName)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
martyuniAuthor Commented:
Masterpass - Yes the directory is on the same IIS server as the site

drypz - I will try this when I go back to work tomorrow and let you know, thanks for the help.

0
martyuniAuthor Commented:
Thank you very much.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.