Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:30:41+00:00 2026-05-25T01:30:41+00:00

I thought I had my uploads working correctly on Friday, but when I tested

  • 0

I thought I had my uploads working correctly on Friday, but when I tested the site this morning, it doesn’t work right. My uploads are supposed to be going into an uploads/ file and then to a file that corresponds to the ProductID to which that upload is going.

Ex: My Test Product is ProductID 519. I want to upload a document so it should go to uploads/519. When I hover over the uploaded file, it says uploads/519/PhoneList.xls – which is correct. But when I check my Solution Explorer in Visual Studio 2010, the file shows up outside of the 519 file as 519PhoneList.xls

Can someone tell me why this is happening and help me figure out how to fix it? I’ve tried deleting a / here and there but I can’t find the right place to fix.

 Protected Sub SubmitDocument_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SubmitDocument.Click
    DocumentModal.Hide()
    'Builds the full absolute URL to be inserted into the database. 
    Dim hostURL As String = Request.Url.Scheme & "://" & Request.Url.Host & ":" & Request.Url.Port & Request.ApplicationPath
    Dim sqlFileHREF As String = Nothing
    Dim MarketingTitle As String = DocumentTitle.Text
    'SQL INSERT: Marketing Table
    sqlFileHREF = "INSERT INTO Marketing (ProductID, MarketingTypeID, MarketingTitle, MarketingData) VALUES (" & ProductID.Value & " ,4, '" & DocumentTitle.Text & "', '" & hostURL & "uploads/" & ProductID.Value & "/" & DocumentUpload.FileName & "')"
    sqlFileHREF.Replace("'", "''")
    DocumentUpload.PostedFile.SaveAs(Server.MapPath("/uploads/" & ProductID.Value & DocumentUpload.PostedFile.FileName))
    'Create SQL Connection
    Dim SqlConnection As New SqlConnection("Server=off-db1;uid=productsDB_admin;pwd=*****;database=Products")
    SqlConnection.Open()
    Dim sqlCommand As New SqlCommand(sqlFileHREF, SqlConnection)
    sqlCommand.ExecuteNonQuery()
    SqlConnection.Close()
    Response.Redirect(Request.RawUrl)
End Sub 


<!-- Add a Document -->
    <li>
        <asp:LinkButton ID="DocumentButton" runat="server">Document</asp:LinkButton>
        <asp:Panel ID="DocumentPanel" runat="server" CssClass="modalPopup" Style="display:none">
            Title:<asp:TextBox ID="DocumentTitle" runat="server"></asp:TextBox>
            <asp:FileUpload ID="DocumentUpload" runat="server" />
            <asp:Label ID="DocumentLabel" runat="server"></asp:Label>
            <asp:Button ID="SubmitDocument" runat="server" Text="Upload" onclick="SubmitDocument_Click" /><asp:Button ID="CancelDocument" runat="server" Text="Cancel" /><asp:HiddenField ID="filename" runat="server" />
        </asp:Panel>       
        <asp:ModalPopupExtender ID="DocumentModal" runat="server" DropShadow="True" DynamicServicePath="" Enabled="True" PopupControlID="DocumentPanel" TargetControlID="DocumentButton"></asp:ModalPopupExtender>
    </li>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:30:42+00:00Added an answer on May 25, 2026 at 1:30 am

    Do the folder 519 exists ?

    DocumentUpload.PostedFile.SaveAs(Server.MapPath(“/uploads/” & ProductID.Value & DocumentUpload.PostedFile.FileName))

    That line has an error, you’re missing a & “/” between productid.value and postedfile.filename.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought I had got this to work before, but I just don't see
I thought I had seen a bug report about this on the jQuery site,
I thought I had this figured out but it turns out I'm just deleting
Alright, I thought I had this whole setTimeout thing perfect but I seem to
I thought I had this one pretty good, but I just keep running into
I thought I had a pretty good handle on memory management for objective-c, but
This may seem like a programming 101 question and I had thought I knew
I folks. This might be more of a design question but I thought I'd
I had thought I could enumerate the types using IMetaDataImport.EnumTypeDefs and for each of
Generally, I had thought it was always better to store images in the filesystem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.