Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
node-ftp-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mickael Gomez
node-ftp-server
Commits
1296b95d
Commit
1296b95d
authored
Mar 7, 2021
by
Nicolas Fernandes
Browse files
Options
Downloads
Patches
Plain Diff
tentative stor
parent
37d9d5c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
commands/stor.js
+15
-13
15 additions, 13 deletions
commands/stor.js
with
15 additions
and
13 deletions
commands/stor.js
+
15
−
13
View file @
1296b95d
...
...
@@ -2,18 +2,20 @@ export default {
commandName
:
'
STOR
'
,
handler
:
async
({
socket
,
message
,
fs
,
commands
},
write
)
=>
{
//await write(socket, "150 Here comes the directory listing.");
socket
.
write
(
`150 Opening ***** mode data connection for world_bob.\r\n`
);
//await commands.connector.dataSocket.write(res);
//listen
const
fileBuffer
=
commands
.
connector
.
dataSocket
.
once
(
'
data
'
,
buffer
=>
console
.
log
(
buffer
.
toString
()));
// let res;
// try {
// res = await fs.stor(message, fileBuffer);
// } catch (error) {
// res = error;
// }
// await commands.connector.destroyDataSocket();
// await write(socket, "226 Transfer complete.");
socket
.
write
(
`150 Opening ASCII mode data connection for
${
message
}
.\r\n`
);
setTimeout
(
async
()
=>
{
//console.log(commands.connector.dataSocket);
// await write(commands.connector.dataSocket,"")
commands
.
connector
.
dataSocket
.
on
(
'
data
'
,
buffer
=>
{
//console.log(buffer)
fs
.
stor
(
message
,
buffer
).
then
((
res
)
=>
{
console
.
log
(
res
)
write
(
socket
,
"
226 Transfer complete.
"
);
}).
catch
((
err
)
=>
{
console
.
error
(
err
)
});
});
// commands.connector.destroyDataSocket()
},
500
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment