in reply to Using SQL LOAD DATA INFILE via CGI

The best i can say is to upload the users file to another name, then use it. Otherwise, the library function which the LOAD DATA INFILE statement uses will not be able to see the datafile (as it probably uses open()). If you upload the users file to /tmp/${userName}.${UserFile}, and then run it, i would guess it would work.
can't sleep clowns will eat me
-- MZSanford

Replies are listed 'Best First'.
Re: Re: Using SQL LOAD DATA INFILE via CGI
by sdyates (Scribe) on Aug 22, 2001 at 20:21 UTC
    I am using the correct syntax for uploading the file. I think you are on to something when you mention uploading the file. I am not sure about the syntax. I basically want to pass the file diredctly to the database through the web browser. I don't want to have to write the file elsewhere. What is the best way to do this?
      I am not much of a CGI programmer, but i know a bit about Database Client libraries, which is why i replied (that, and i'm opionated). I don't think there is a way to tell LOAD DATA INFILE to read from anything but a file. I guess you could use mknod to create a pipe, then fork a process to write to it while LOAD DATA INFILE is reading, but that might be a bit too complex a replacment for a write/load/delete temp file solution ... you make the call . Hope that helps.
      can't sleep clowns will eat me
      -- MZSanford