-
-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if /tmp/ not present example fails (at least on Windows) #88
Comments
I guess I could change the default file upload location to |
Thats how we solve it at etherpad lite var tempDirectory = "/tmp/"; //tempDirectory changes if the operating system is windows if(os.type().indexOf("Windows") > -1) { tempDirectory = "c:\\Temp\\"; } form.uploadDir = tempDirectory; |
Guess I am not competent enough regarding process.cwd() but IMHO Pitas approach seems a bit questionable. At least my Win7 install has no c:\temp folder (I think default is normally c:\windows\temp but that also assumes install dir of Windows is the default). Sorry for not being much of a help but I am more or less new to node. |
Should this work? var fs = require('fs'); problem is that fs.stat returns simple undefined (node 0.5.3), ? |
Sorry (my last comment is proper bullsh*t), this should be (and works too): node -e "var fs = require('fs');fs.stat(process.env.TEMP, function(x, y (somehow this does not work on console (yet) but seems a known bug with { and } in the console) |
@cthedot You're right, looks like the tmp folder differs between windows versions. Thx for that hint |
nice you care about Windows at all :) |
sorry, wrong button, did not meant to close the issue |
Ok, I think using fs.statSync() we should choose between: |
I tried to implement this here https://github.com/cthedot/node-formidable/blob/master/lib/incoming_form.js |
Wait.. why are you using synchronous blocking functions? My server will be dealing with tons of form requests. Having each form request block would be like hell on earth. :) |
actually a good question, in Felix last comment he suggested it, async is no problem here? |
I will take care of this, I mean to use sync functions when the module is loading. |
Hmm right, I still don't see the necessity though. It feels wrong to use blocking functions when there is no need. I assume it's not really an issue though when it's solely during initialization of the module. |
|
Released as v1.0.4. |
trying the formidable example script on Windows (7, 64bit, Nodejs 0.5.3 native .exe) yields the following error:
events.js:48
throw arguments[1]; // Unhandled 'error' event
^
Error: ENOENT, The system cannot find the file specified. '\tmp\2c4faab430e45c01747400ba
48f1465f'
When adding a \tmp\ folder on hard disk volume it works flawlessly (default temp folder should be environ var TEMP or TMP which would be c:\temp or c:\Windows\temp for untampered installations at least).
I guess (maybe naively) this could be fixed easily? Giving an informative error message would be at least something. :)
BTW, nice lib!
The text was updated successfully, but these errors were encountered: