@@ -914,12 +914,14 @@ public string UpdateProductImages(HttpContext context)
914914 {
915915 if ( ImgUtils . IsImageFile ( Path . GetExtension ( img ) ) && img != "" )
916916 {
917+ var extension = Path . GetExtension ( img ) ;
917918 var fn = DnnUtils . Encrypt ( img , StoreSettings . Current . Get ( "adminpin" ) ) ;
918919 foreach ( char c in System . IO . Path . GetInvalidFileNameChars ( ) )
919920 {
920921 fn = fn . Replace ( c , '_' ) ;
921922 }
922- var extension = Path . GetExtension ( img ) ;
923+ fn = extension + "-" + fn ; // add extension to front, so it cannot be servered but we can add to order data.
924+
923925 var fullName = StoreSettings . Current . FolderTempMapPath . TrimEnd ( Convert . ToChar ( "\\ " ) ) + "\\ " + fn ;
924926 if ( File . Exists ( fullName ) )
925927 {
@@ -929,7 +931,7 @@ public string UpdateProductImages(HttpContext context)
929931 imageInfo = NBrightBuyUtils . ProcessImageProvider ( "product" , imageInfo ) ;
930932 var newfullName = imageInfo . GetXmlProperty ( "genxml/uploadedimagemappath" ) ;
931933 if ( newfullName != "" ) fullName = newfullName ;
932-
934+
933935 // deal with image
934936 File . Move ( fullName , fullName + extension ) ;
935937 fullName = fullName + extension ;
@@ -1156,8 +1158,9 @@ public string UpdateProductDocs(HttpContext context)
11561158 {
11571159 fn = fn . Replace ( c , '_' ) ;
11581160 }
1161+ fn = extension + "-" + fn ; // add extension to front, so it cannot be servered but we can add to order data.
11591162
1160- string fullName = StoreSettings . Current . FolderTempMapPath + "\\ " + fn ;
1163+ var fullName = StoreSettings . Current . FolderTempMapPath . TrimEnd ( Convert . ToChar ( " \\ " ) ) + "\\ " + fn ;
11611164 //if ((extension.ToLower() == ".pdf" || extension.ToLower() == ".zip"))
11621165 //{
11631166 if ( File . Exists ( fullName ) )
0 commit comments