Project

General

Profile

WFileUpload and tmp directory

Added by Marcelo Antunes over 3 years ago

I have a wfileupload wich when i pick a file, it fires the changed signal that is connected to this slot:

 fileUploader->upload();

But the file is not uploaded to the folder defined on WT_TMP_DIR neither the uploaded signal is fired.

The folder has this permissions:

drwxrwxrwx  2 www-data www-data 

Could you please help me?

PS: I'm using apache with fastcgi, so the www-data is the user from apache.


Replies (3)

RE: WFileUpload and tmp directory - Added by Marcelo Antunes over 3 years ago

someone can help me?

RE: WFileUpload and tmp directory - Added by Wim Dumon over 3 years ago

Hey Marcelo,

We don't really recommend using the fcgi backend. In the context of file uploads, it will for example not be able to display the upload progress.

There's a number of places where things can go wrong:

  • on the http server: file is first spooled there. This may fail because it's too large, it can't be written to disk, or other misconfiguration
  • then the file is sent to Wt. Without WT_TMP_DIR, the system tmp dir is used (/tmp on Linux). Make sure that WT_TMP_DIR is set in the environment that wt runs in, if that is important to you.
  • from a quick look at the fcgi connector's source code, I didn't spot obvious configuration parameters that come into play.

BR,

Wim.

RE: WFileUpload and tmp directory - Added by Marcelo Antunes over 3 years ago

The toolarge event is not fired, but with the things that you said, i don't know if is the fcgi that isn't compatible, or if is other thing.
I did a

setenv("WT_TMP_DIR","/tmp",1);

and then on the filechanged event i did a

std::getenv("WT_TMP_DIR");

and the var is correctly defined as "/tmp"

Might be related with the permission of the tmp dir?

    (1-3/3)