Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 06 NOV 2012 09:09:13AM Enrique Murphy wrote:

After upgrading to OI 9.3.2: file uploads are not working with FileModes 1 or 2. They just work with FileMode 3, but to use this mode I would have to change all the programs that upload information.

I have not changed the configuration of the upload, it was working in OI 9.3.1 and it stopped working when I applied the OI 9.3.2 - 18 Sept build. My configuration is:

FileMode=1

FilePath=uploads\

When debugging, the request for the file input (for example, FILE1) comes with the word ERROR, and FILE1.filename and FILE1.LENGTH and CONTENTTYPE come with the right values.

The SYSTEM user has total control over the uploads folder. This is on a Windows 2008 server.

Any ideas?


At 06 NOV 2012 01:26PM bshumsky wrote:

After upgrading to OI 9.3.2: file uploads are not working with FileModes 1 or 2. They just work with FileMode 3, but to use this mode I would have to change all the programs that upload information.

I have not changed the configuration of the upload, it was working in OI 9.3.1 and it stopped working when I applied the OI 9.3.2 - 18 Sept build. My configuration is:

FileMode=1

FilePath=uploads\

When debugging, the request for the file input (for example, FILE1) comes with the word ERROR, and FILE1.filename and FILE1.LENGTH and CONTENTTYPE come with the right values.

The SYSTEM user has total control over the uploads folder. This is on a Windows 2008 server.

Any ideas?

Hi, Enrique. The upload process itself, contained in the OECGI3.EXE, didn't change at all AFAIK between 9.3.1 and 9.3.2. There were some changes in the O4WUpload process though - are you using O4W? If not, I can only ask if something else has changed on your web server - it does sound like a permissions issue. Note that your FilePath is a _relative_ file path, rather than an absolute one, so perhaps the "uploads" folder you were expecting the file to be written isn't the one that's really getting used…

Hope that helps,

- Bryan Shumsky

Revelation Software, Inc.


At 07 NOV 2012 10:19PM bob carten wrote:

Hi Enrique,

I made a test program to upload a file.

I started with the example from the OECGI3 Quickstart Guide located in the Documents folder under OpenInsight.

I fond I needed to fix a few things for that to work. The code example below works for me

Given a form which looks like


html = '<html>'

	html := crlf$ : '<body>'

	html := crlf$ : '<form name="myform" action="./rjc" method="POST"'

	html := crlf$ : 'enctype="multipart/form-data">'

	html := crlf$ : '<input name="myfilename" type="file" size="50">'

	html := crlf$ : '<input name="SUBMIT" type="SUBMIT" value = "Submit">'

	html := crlf$ : '</form>'

	html := crlf$ : '</body>'

	html := crlf$ : '</html>'

I can import the file using code like

/*

	OECGI3 saves the uploaded data To the location that is in the  OECGI3 registry entry filepath

	OECGI3 will assign a temporary name. Request will contain the temporary name And the original user-supplied name

	the temporary name will include the filepath.

	

	Note: if the filepath registry setting is a relative path, for example \UPLOADS\

	Then the actual location will be relative To OECGI3 And you will need To adjust the path	

	*/

	

	home = drive()

	if home[-1,1] = '\' else home := '\'

	

	// For FileMode = 1 & 2

	// Get the name of the file as assigned by OI

	temp_filename = inet_queryparam(request,"myfilename")

		

	// Absolute path? else prepend the OECGI3 folder

	is_absolute_path = Index(temp_filename, ':', 1) Or Index(temp_filename, '\\', 1)

	If Not(is_absolute_path) Then

	    // Assume OECGI3 is in o4w folder		

		oecgiFolder = home:'o4w\'

		temp_filename = oecgiFolder:temp_filename

	end

	// Get the user-supplied name of the file

	userSuppliedFileName = inet_queryparam(request,"myfilename.filename")

	

	// You should always sanitize data from the web to protect

	// against script injections, bad filename uploads etc

	

	saveAsFilename = Iconv(userSuppliedFileName, '[URL_FORMAT]')

	

	// Now copy the uploaded file to somewhere on our server so that we can process it

	permanentFolder = home:'O4W\DOWNLOADS\'

	osread data From temp_filename Then

		oswrite data on permanentFolder:saveAsFilename

	end

	

	html = '<html>'

	html := crlf$ : '<body>'

	html := crlf$ : '<h2>Uploaded ':Quote(saveAsFilename):' </h2>'

	html := crlf$ : '</body>'

	html := crlf$ : '</html>'

I don't know if something changed or if the example in the quickstart guide was always wrong.

- Bob


At 09 NOV 2012 09:45AM Enrique Murphy wrote:

Something should have changed from version 9.3.1 to 9.3.2,as at 9.3.1, I had a folder C:\Temp\Uploads\ (not relative to the folder in which OECGI3.EXE resides) configured as the "FilePath", and it was working..

In my case, OECGI3.EXE resides inside inetpub\wwwroot. I made several tests creating and setting folders inside this folder, but without luck. I did set full control permissions to the SYSTEM and IIS_IUSRS users in them, so Oengine Server and Web Server had full permissions, but wasn't enough, it started working when I assigned full permissions to <Domain>\Users (??). I also tried to assign them to CREATOR OWNER, but Windows didn't let me. It would be cool to add a section in the OECGI3 doc about which permissions should be assigned to which users for uploading to work.

I believe there is a difference in Windows 7, or 2008, between the inetpub folder and the OI folder, so if OECGI3.EXE is in O4W folder, for example.

Anyway, it is working again now.

Thanks

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/4acc0d672dd88c2c20d0af324.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1