I my description of the upload facility I'm using, I should
have noted that one of the problems I ran into was large files
did not work directly because of buffer limitations in j's
implementation of stdin... So my upload form invoked this CGI

#!/bin/bash
tf=/tmp/fdat$$
cat > $tf
./pfdat $tf "$REMOTE_ADDR" "$HTTP_USER_AGENT" "$$"

were the last line is the call to a j #! script "pfdat" which
did the other things I described in my previous message. This
was a very good work around for the stdin buffering issues.

- joey


At 09:21  -0700 2007/05/30, Oleg Kobchenko wrote:
There is a new version of JHP with upload support.
Thanks to Ric Sherlock for the prototype.

The interface is
  qparam key - value of parameter or file content
  qparamFile key - original file name, or '' if not a file
  qparamMime key - content MIME type

See if that works. I noticed a problem that when calling
stdin'' not all content is loaded on larger files.

If this works, we can how to incorporate saving
temporary files. Or you can save content directly
from memory to intended locations.


--- "Sherlock, Ric" <[EMAIL PROTECTED]> wrote:

 > [mailto:[EMAIL PROTECTED] On Behalf Of Oleg Kobchenko
 >
 > This looks great. Before interning, I would like to provide
 > separation between parsing and storage.
 > Please elaborate on the use cases that you have right now and
 > hypothetical, which would require writing files directly to
 > temp folders.
 >
 > The pattern that I am familiar with is
 >  - use designated system temp folder
 >  - use automatic mangled unique temp name
 >  - create file with flag to automatically delete upon process exit
 >    (like J break files)
 >
 > So it would require two file names: original and physical.
 >

 I agree that it makes sense to separate the writing of any file(s) from
 the parsing of the upload.
 As you say two file names are then required. One option would be for
 qmparse to return the original file name of any uploaded files in dat,
 return the physical (mangled unique) filename in fnmes, and return an
 additional vector of expanded fdat

 I have made some changes to the code on my wiki page comment to
 illustrate these ideas.

 My current need for this functionality is as follows:
 I am providing a breeding population simulation for a students in which
 they download selection lists (csv) of potential parents. Based on their
 selection strategy they then upload lists (csv) of chosen sires and
 dams. Each user has their own folder which contains their population and
 from which they download and upload their csv files. Users log on and
 their session is maintained using a userid cookie. The upload location
 is determined by looking up their userid.
 This is currently implemented using an APL webserver, but I'm keen to
 replace that with IIS & JHP.




____________________________________________________________________________________Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to