Note that there are some explanatory texts on larger screens.

plurals
  1. POFiles I upload are not going into the right folder
    text
    copied!<p>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.</p> <p>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</p> <p>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.</p> <pre><code> 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 &amp; "://" &amp; Request.Url.Host &amp; ":" &amp; Request.Url.Port &amp; 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 (" &amp; ProductID.Value &amp; " ,4, '" &amp; DocumentTitle.Text &amp; "', '" &amp; hostURL &amp; "uploads/" &amp; ProductID.Value &amp; "/" &amp; DocumentUpload.FileName &amp; "')" sqlFileHREF.Replace("'", "''") DocumentUpload.PostedFile.SaveAs(Server.MapPath("/uploads/" &amp; ProductID.Value &amp; 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 &lt;!-- Add a Document --&gt; &lt;li&gt; &lt;asp:LinkButton ID="DocumentButton" runat="server"&gt;Document&lt;/asp:LinkButton&gt; &lt;asp:Panel ID="DocumentPanel" runat="server" CssClass="modalPopup" Style="display:none"&gt; Title:&lt;asp:TextBox ID="DocumentTitle" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:FileUpload ID="DocumentUpload" runat="server" /&gt; &lt;asp:Label ID="DocumentLabel" runat="server"&gt;&lt;/asp:Label&gt; &lt;asp:Button ID="SubmitDocument" runat="server" Text="Upload" onclick="SubmitDocument_Click" /&gt;&lt;asp:Button ID="CancelDocument" runat="server" Text="Cancel" /&gt;&lt;asp:HiddenField ID="filename" runat="server" /&gt; &lt;/asp:Panel&gt; &lt;asp:ModalPopupExtender ID="DocumentModal" runat="server" DropShadow="True" DynamicServicePath="" Enabled="True" PopupControlID="DocumentPanel" TargetControlID="DocumentButton"&gt;&lt;/asp:ModalPopupExtender&gt; &lt;/li&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload