Skip to content

Commit

Permalink
use clientuploadfilelist field for ajax fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
leedavi committed Mar 29, 2024
1 parent 47a9c80 commit b633737
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Components/PurchaseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ public String AddSingleItem(String strproductid, String strmodelId, String strqt
objInfo.AddSingleNode("itemcode", itemcode.TrimEnd('-'), "genxml");

// check if we have a client file upload
var clientfileuopload = objInfoIn.GetXmlProperty("genxml/hidden/optionfilelist") != "";
var clientfileuopload = objInfoIn.GetXmlProperty("genxml/textbox/clientuploadfilelist") != "";
if (!clientfileuopload) clientfileuopload = objInfoIn.GetXmlProperty("genxml/hidden/optionfilelist") != ""; // Legacy

//replace the item if it's already in the list.
var nodItem = PurchaseInfo.XMLDoc.SelectSingleNode("genxml/items/genxml[itemcode='" + itemcode.TrimEnd('-') + "']");
Expand All @@ -538,7 +539,8 @@ public String AddSingleItem(String strproductid, String strmodelId, String strqt
if (clientfileuopload)
{
// client has uploaded files, so save these to client upload folder and create link in cart data.
var flist = objInfoIn.GetXmlProperty("genxml/hidden/optionfilelist").TrimEnd(',');
var flist = objInfoIn.GetXmlProperty("genxml/textbox/clientuploadfilelist").TrimEnd(',');
if (flist == "") flist = objInfoIn.GetXmlProperty("genxml/hidden/optionfilelist").TrimEnd(','); // Legacy
foreach (var f in flist.Split(','))
{
if (f != "")
Expand All @@ -549,7 +551,7 @@ public String AddSingleItem(String strproductid, String strmodelId, String strqt
fn = fn.Replace(c, '_');
}
var extension = Path.GetExtension(f);
var fullName = StoreSettings.Current.FolderTempMapPath.TrimEnd(Convert.ToChar("\\")) + "\\" + fn;
var fullName = StoreSettings.Current.FolderTempMapPath.TrimEnd(Convert.ToChar("\\")) + "\\" + extension + "-" + fn;
if (File.Exists(fullName))
{
var newDocFileName = StoreSettings.Current.FolderClientUploadsMapPath.TrimEnd(Convert.ToChar("\\")) + "\\" + Guid.NewGuid() + extension;
Expand Down
1 change: 1 addition & 0 deletions Providers/PromoProvider/PromoProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
</Compile>
<Compile Include="DiscountCodes.ascx.cs">
<DependentUpon>DiscountCodes.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DiscountCodes.ascx.designer.cs">
<DependentUpon>DiscountCodes.ascx.cs</DependentUpon>
Expand Down

0 comments on commit b633737

Please sign in to comment.