Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HIMSScannerService
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HIMSScanner
HIMSScannerService
Commits
d4e10d34
Commit
d4e10d34
authored
Jun 03, 2026
by
Krishna Reddy Tamatam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed done for file types in Comparessed icons
parent
53176dd4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
27 deletions
+40
-27
FluentFtpService.cs
Models/FluentFtpService.cs
+40
-27
No files found.
Models/FluentFtpService.cs
View file @
d4e10d34
...
...
@@ -324,42 +324,55 @@ public class FluentFtpService
byte
[]
fileBytes
=
await
File
.
ReadAllBytesAsync
(
localFilePath
);
string
extension
=
Path
.
GetExtension
(
localFilePath
)
.
ToLowerInvariant
();
// PDF
if
(
extension
==
".pdf"
)
string
extension
=
Path
.
GetExtension
(
localFilePath
).
ToLowerInvariant
();
if
(
extension
==
".jpg"
||
extension
==
".jpeg"
||
extension
==
".png"
||
extension
==
".gif"
||
extension
==
".bmp"
||
extension
==
".tif"
||
extension
==
".tiff"
)
{
string
base64
=
Convert
.
ToBase64String
(
fileBytes
);
using
Image
image
=
payload
.
Type
==
2
?
Image
.
Load
(
DecryptFTPFile
(
fileBytes
,
encryptionKey
))
:
Image
.
Load
(
fileBytes
);
results
.
Add
((
fileName
,
base64
,
null
));
image
.
Mutate
(
x
=>
x
.
Resize
(
width
,
height
));
continue
;
}
using
var
ms
=
new
MemoryStream
();
// Images
using
Image
image
=
payload
.
Type
==
1
?
Image
.
Load
(
DecryptFTPFile
(
fileBytes
,
encryptionKey
))
:
Image
.
Load
(
fileBytes
);
image
.
SaveAsJpeg
(
ms
);
image
.
Mutate
(
x
=>
x
.
Resize
(
width
,
height
));
string
base64
=
Convert
.
ToBase64String
(
ms
.
ToArray
());
using
var
ms
=
new
MemoryStream
();
results
.
Add
((
fileName
,
base64
,
null
));
}
else
if
(
extension
==
".mp4"
)
{
// MP4 -> return original video bytes as Base64
string
base64
=
Convert
.
ToBase64String
(
fileBytes
);
image
.
SaveAsJpeg
(
ms
);
results
.
Add
((
fileName
,
base64
,
null
));
}
else
{
results
.
Add
((
fileName
,
null
,
$"Unsupported file type:
{
extension
}
"
));
}
string
imageBase64
=
Convert
.
ToBase64String
(
ms
.
ToArray
());
// // PDF
// if (extension == ".pdf")
// {
// string base64 =
// Convert.ToBase64String(fileBytes);
results
.
Add
(
(
fileName
,
imageBase64
,
null
));
// results.Add((fileName, base64, null));
// continue;
// }
}
catch
(
Exception
ex
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment