Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
stevewood  
#1 Posted : Monday, December 17, 2007 3:22:29 PM(UTC)
stevewood

Rank: Member

Groups: Member
Joined: 12/17/2007(UTC)
Posts: 21

Are all of the fields in the POST Field Reference of Type=File? Or are some of them Type=Text, etc.? In the programming language I use, I need to know the Form id, Name and Input id, what are those values?
Alex Makhov  
#2 Posted : Wednesday, December 19, 2007 6:34:29 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Administration
Joined: 8/3/2003(UTC)
Posts: 998

Hello Steve,

Sorry for the long delay.

Here is a part of POST request generated by Image Uploader:

--OY0bLSv8i-mP1hSCOqWjRfAkyKiGYuu9GOD_

Content-Disposition: form-data; name="Author"

Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

Alex

--OY0bLSv8i-mP1hSCOqWjRfAkyKiGYuu9GOD_

Content-Disposition: form-data; name="FileCount"

Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8bit

1

--OY0bLSv8i-mP1hSCOqWjRfAkyKiGYuu9GOD_

So not all fields are of type FILE. If you want to get Form ID, Input ID or any other text field from the client's page, add them as hiden fields to the form on your page and use the AdditionalFormName property or AddField method to send it to the server.

Edited by user Monday, February 25, 2008 3:05:53 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

stevewood  
#3 Posted : Wednesday, December 19, 2007 10:56:15 PM(UTC)
stevewood

Rank: Member

Groups: Member
Joined: 12/17/2007(UTC)
Posts: 21

Alex,

Thank you. I was able to move on pretty soon after my initial post. I had a basic misunderstanding. One nice thing I discovered is that the development platform I am using is much more simple than any or the other examples in the Samples area. So I was working too hard trying to translate those samples in to my enviroment.

Here is my draft code for processing the upload, moving image and thumb to the proper folder and adding a record to a table for each image:

Code:
strImagePath   = "[PathAlias.Image_Path]\\"+ session.album
strThumbsPath = "thumbs\\"+ session.album

if file.exists(strImagePath) = .f.
  file.dir_create(strImagePath)
end if
if file.exists(strThumbsPath) = .f.
  file.dir_create(strThumbsPath)
end if

dim tbl as p
tbl=table.open("[PathAlias.ADB_Path]\photoimage")
	tbl.enter_begin()
		tbl.User_id = session.ulink
		tbl.Albumid = session.album
		tbl.Filename = SourceFile_1.filename
	tbl.enter_end()
tbl.close()	

file.from_blob(strImagePath+"\\"+ SourceFile_1.filename,SourceFile_1.data)
file.from_blob(strThumbsPath+"\\"+Thumbnail1_1.filename,Thumbnail1_1.data)
file.from_blob(strThumbsPath+"\\"+Thumbnail2_1.filename,Thumbnail2_1.data)

Edited by user Monday, February 25, 2008 3:08:48 PM(UTC)  | Reason: Not specified

Alex Makhov  
#4 Posted : Thursday, December 20, 2007 8:48:14 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Administration
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

So did my advice help you to implement you functionality?

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

stevewood  
#5 Posted : Thursday, December 20, 2007 9:23:44 PM(UTC)
stevewood

Rank: Member

Groups: Member
Joined: 12/17/2007(UTC)
Posts: 21

Alex,

Not directly. I already had a list of field names using a function such as request.raw which lists them all out, in the same fashion you did below. I had a basic misunderstanding on how to extract the value from each field. Somewhere in your documentation I got the impression that all fields might be Type=File. POST is a new area to me, and that was the cause.

I am on to bigger problems, making sure java installs and the process works on all browsers. Java and ActiveX components behave differenty in the demo - ActiveX will upload multiple files giving one Demo warning dialog at the start, but will complete the upload. Java gives that same warning on EACH file that is being uploaded. Using the same upload script, ActiveX processes the upload, but Java does, or at least SourceFile_1 is always blank and it errors out. I am sure this is my own bug in my script.

Alex Makhov  
#6 Posted : Tuesday, December 25, 2007 12:13:09 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Administration
Joined: 8/3/2003(UTC)
Posts: 998

Hello Steve,

Text fields do not have File type. They all are text/plain.

As about the warnings on each file, could you describe it in more details and we will fix the problem if it is.

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.