Support #1035
closedbehavior of spoolFileName and clientFileName
Description
Hello:
I'm using the WFileUpload widget to allow a client to upload files to a server running windows xp. I'm seeing some behavior that I didn't expect, and am having trouble working around it.
1) Post-upload, my call to WFileUpload::spoolFileName() returns the truncated path "C:\DOCUME~1\Joe\LOCALS~1\Temp\wt-4D.tmp". Is there a way to get the full filename through wt?
If not, is there a way to set the default spool target directory through the Wt API or in wt_config.xml?
2) Post-upload, my call to WFileUpload::clientFileName() returns the filename portion of the upload file rather than the full path. (i.e. if the file upload widget contained C:\blah\file.txt the function call returns file.txt.) Is there a way to return the full path?
Many thanks
Matthew
Updated by Wim Dumon about 13 years ago
Hello Matthew,
1) See getTempDir() in src/web/Utils:
std::string getTempDir()
{
std::string tempDir;
char *wtTmpDir = getenv("WT_TMP_DIR");
if (wtTmpDir)
tempDir = wtTmpDir;
else {
#ifdef WIN32
char winTmpDir[MAX_PATH];
if(GetTempPathA(sizeof(winTmpDir), winTmpDir) != 0)
tempDir = winTmpDir;
#else
tempDir = "/tmp";
#endif
}
return tempDir;
}
By default, we use the path as it is reported by getTempDir(), but you can override it by setting the WT_TMP_DIR environment variable.
2) This depends on the browser. This call returns what the browser has sent us.
Wim.
Updated by Koen Deforche about 13 years ago
- Status changed from New to Resolved
- Assignee set to Wim Dumon
Updated by Koen Deforche about 13 years ago
- Status changed from Resolved to Closed
- Target version set to 3.2.0