-
Notifications
You must be signed in to change notification settings - Fork 7
File upload example #21
Comments
Yes, I tested it with binary and text uploads.
I was able to store images in both MySQL and MongoDB.
I think there is a fs module that's very low level. In the modules/
directories?
…On Thu, Dec 8, 2016 at 3:48 PM mm765 ***@***.***> wrote:
The example http-test2 seems to be not working here. it can't even find
the require'd 'fs'.
I believe 'fs' has been renamed to File is that correct ?
If so, File has a slightly different interface, so the example still won't
work.
But my main question actually is:
there is a comment in there stating "tested with binary and text uploads."
and i wanted to know if that really was the case or if this was an example
copied from somewhere else and never converted to decaf ?
Thanks in advance,
Matthias
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUHpdlA7TCxaLhJmTIP2_KKZiGWFSP8ks5rGJdkgaJpZM4LIa7h>
.
|
There is a fs.js as builtin but it has only 4 methods: isFile, isDir, realpath and readFile. Do you think it might be possible that there was another fs.js in one of those paths on your system and you accidentally used that one ? |
There was a fs module at one point. I probably ditched it for the File
module. I must have not fixed the test program.
…On Fri, Dec 9, 2016 at 11:48 AM mm765 ***@***.***> wrote:
There is a fs.js as builtin but it has only 4 methods: isFile, isDir,
realpath and readFile.
The writeFile method in the File module doesnt take a filename as a first
parameter but only the content, append flag and an encoding).
i searched for a few hours now and i'm at my wits end. The only thing i
can think of is that you had another fs.js somewhere which got included
because require.js has some predefined paths:
/**
* This is an array of file system paths that are searched for modules when
require() is called. These may be relative to the current directory where
decaf is launched, or absolute paths.
* @Property <https://github.com/property>
*
* @type <https://github.com/type> {Array}
*/
require.paths = [
'bower_components',
'bower_components/decaf/modules',
'node_modules',
'modules',
'/usr/local/decaf',
'/usr/local/decaf/modules',
'./'
];
Do you think it might be possible that there was another fs.js in one of
those paths on your system and you accidentally used that one ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAUHpfe3dXPuHIn4G_i7-dYDMYP_blIqks5rGbCFgaJpZM4LIa7h>
.
|
I found the problem. The post data is read into a "latin1" encoded string but the writefile was done without any specific encoding, so it used the system encoding which in my case is UTF-8. |
The example http-test2 seems to be not working here. it can't even find the require'd 'fs'.
I believe 'fs' has been renamed to File is that correct ?
If so, File has a slightly different interface, so the example still won't work.
But my main question actually is:
there is a comment in there stating "tested with binary and text uploads." and i wanted to know if that really was the case or if this was an example copied from somewhere else and never converted to decaf ?
Thanks in advance,
Matthias
The text was updated successfully, but these errors were encountered: