Forum Moderators: coopster & phranque

Message Too Old, No Replies

Uploading a spreadsheet and sending to server-side program. Possible?

         

coolvirus

4:09 pm on Feb 13, 2002 (gmt 0)



We're using Netscape server.
The language used on the server side is C.
What I want to do with the data is the following:
Right now I have an html form with a few columns. The users input data into the columns and then submit it. I receive this data and using C and embedded SQL, I insert it into an Ingres database.

Some users have told me that they already have the data in spreadsheets. So they want to know if there's a way for me to read in the info in the spreadsheets and populate the html form, instead of them having to type the data into the spreadsheet and then re-type it into the html form.

Can this be done?
Thanks in advance.

cyril kearney

5:06 am on Feb 14, 2002 (gmt 0)

10+ Year Member



The current vesion of Excel can interact with remote databases using VBA (Visual Basic for Applications). The spreadsheet application requests data from an ODBC source and accepts the returned data into rows and columns.

I've used it to get data from a SQL Server and it performs flawlessly.

A request can be made to an Internet page which would format the output for Excel. I see no reason why a Netscape server/Ingress could not be programmed to work with Excel.

gethan

8:46 am on Feb 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> using VBA (Visual Basic for Applications). The spreadsheet application requests data

Equally can be used to input data.

If you want to make a completely web based solution. At a high level you'll need something like this.

1) Get the spreadsheet exported in a predetermined format (you define the column order) - export tab delimited.

2) Use an upload form to get this exported version onto the webserver.

3) Use a cgi app to parse the data and insert to db.

In perl this would all be very simple, the hardest part would be to ensure that your users format the data correctly before uploading.

HTH and welcome to WmW.

coolvirus

1:43 pm on Feb 14, 2002 (gmt 0)



I saved the Excel spreadsheet in comma separated format. And I am submitting the file to the webserver.

My problem now is that I don't see anything coming in from stdin (POST method) or in the QUERY_STRING (GET method).

At first I thought that the contents of the file would be sent as a name-value pair, just like the other fields.
But it seems that that's not the case. It seems that the file itself gets saved to the webserver and then I need to open it and read the data in it.

Is that how it works?
How do uploaded files come in to the webserver?

txbakers

4:46 pm on Feb 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a commercial, but not for me. I use a product called Actuate which is a great server side report writer and distributor.

They have a product called "e.Spreadsheet" which is a java based server side spreadsheet generator.

It's good.

gethan

5:12 pm on Feb 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here [cgi.resourceindex.com] are a load of perl progs for uploading files... the best bet is to study them and write your own.

Basically you need some extra information in your form, and cgi script that will handle the results;

eg. <form method='POST' enctype='multipart/form-data' action='upload.cgi'>

And the form must contain an <input type=file>

The translation from Perl to C is up to you ;) Not a C programmer.