We are attempting to use O4WUPLOADBOX on OI 9.4.2 with oecgi3.exe as follows:
destination = 'O4W/Uploads/^.$' ;* This works in filemode = 3
length = 30
name = htmlCtrlEntID
id = htmlCtrlEntID
style = ''
O4WUPLOADBOX(default, destination, length, name, id, style)
In the Registry:
Filepath = \Uploads\
Filemode = 3
I'm pleased to report that with a text file this works perfectly. When I change the Filemode to 2 the contents of the text file becomes: ERROR
What do we need to do to get this working with .pdf's and text files?
TIA
Robert Lee
Hi, Robert.
Just to explain - file mode of '3' means send the data directly into OI, which is fine for text files but not appropriate for binary data (like pdfs). File mode of '2' means write the information into the specified output folder.
I would have to say that 99% of the time, the error has to do with permissions/rights on the folder.
If you look in the \uploads\ folder (and by the way, where is that supposed to actually reference - a folder under the OI directory? A folder under the IIS directory?), do you see anything written there?
I should also verify, before we proceed with additional diagnostics - is this a "split" system (where the web server and the engine server/OI are on different machines), or an "all in one" system where the web server and the OI and engine server are all on the same machine?
- Bryan Shumsky
Hi Bryan
1. I have checked the rights on the folder and "Everyone" has access at this point.
2. The Uploads folder is ..\Oinsight\O4W\Uploads
3. in File Mode 3 my test text file "Hello World.txt" gets successfully placed there . In File Mode 2 the file is placed there but the contents of the file is "ERROR".
4. This is an 'all in one" system.
Robert Lee
Hi Bryan
1. I have checked the rights on the folder and "Everyone" has access at this point.
2. The Uploads folder is ..\Oinsight\O4W\Uploads
3. in File Mode 3 my test text file "Hello World.txt" gets successfully placed there . In File Mode 2 the file is placed there but the contents of the file is "ERROR".
4. This is an 'all in one" system.
Robert Lee
Hi, Robert. Thanks for the response.
When using O4WUploadBox, we have to collaborate between OECGI and O4W. OECGI is responsible for getting the uploaded file's information, and putting it "somewhere" (as specified in the repository settings), while O4WUploadBox then specifies how that information should be taken from that "somewhere" location and put into your specified destination.
In your example, OECGI will try to initially write the uploaded file's information in \uploads\, and then O4W will try to read it from \UPLOADS\<temporary_file_name>, and move it to O4W/Uploads/ with a new name.
So, a couple of things:
- since OECGI and O4W run in different contexts, potentially (one may be under IIS, and the other under OI), I'd suggest that the registry filepath variable be an explicit path, and not a relative one;
- you MUST be able to see the temporary file written in that explicit path, before we have any expectations of O4W getting the data and moving it. So that's the first test - does the text or PDF file, whichever you try to upload, get written to that explicit location? If not, you may have to change the permissions some more (note that "everyone" in Windows permissions does not really include everyone - you may have to add the "IIS user" explicitly to that list).
Hope that helps,
- Bryan Shumsky
Hi Bryan
Success!
We changed the registry filepath to a explicit path and I'm pleased to report the upload then worked correctly in Filemode = 2. However, another question follows on. We notice that the \Uploads\ folder is becoming littered with GUID file names which are obviously the temporary files placed their by OECGI.
Should these be being deleted automatically or is there a way the program can delete them once they have been used?
Thanks
Robert
Hi Bryan
Success!
We changed the registry filepath to a explicit path and I'm pleased to report the upload then worked correctly in Filemode = 2. However, another question follows on. We notice that the \Uploads\ folder is becoming littered with GUID file names which are obviously the temporary files placed their by OECGI.
Should these be being deleted automatically or is there a way the program can delete them once they have been used?
Thanks
Robert
Hi, Robert. FileMode = 2 tells OECGI "write this file and keep it around." FileMode = 1 tells OECGI "write this file and (after OI/O4W finishes processing it) remove it." So FileMode 2 is best for testing/debugging, and then - if you don't need the original files anymore - you can switch to FileMode 1.
Hope that helps,
- Bryan Shumsky