File upload to database

G

Guest

I want to use a simple form to upload a file to a folder, and at the same
time, record a name (by asking the user to complete a text box) and its full
pathname (using the BROWSE button on file upload control).

When I try to send to a database, the file is neither uploaded nor a record
created in the database. However, if I try to snd to a CSV file, everything
works as it should.

I need the database solution for retrieval, search and other purposes.
 
A

Andrew Murray

The *location* of the file is sent to the database - the file should be
uploaded to the _private folder.

Only a guess here, but check with your host that they aren't restricting
the file types that you can upload. They may only allow, for example simple
ASCII text files i.e. *.csv or *.txt.

I suggest this since you say it works when you choose a csv file but not
with any other file which makes me think its the file type that is causing
the problems.

What type of file are you trying to upload through the form?
 
G

Guest

Thanks for coming back Andrew.

Uploading to a different folder from _private is successful with any type of
file when I send results to a .csv file. Why do you suggest that _private has
to be used? I understand that it is the final "destination" path that is sent
to the database/csv. But for some reason, when I try to send the form results
to a database, the file is neither uploaded nor is it recorded in the
database. The form SEEMS to process in that it takes a moment before clearing
the form. In an attempt to debug, I have added a confirmation form and error
form. Neither is invoked.

I feel that it may have something to do with rights on folders or the
database???

Any help appreciated
 
A

Andrew Murray

I think I've confused you and myself; I'm thinking of when you use the form
handler to send the data to a text (CSV) file - it writes that text file to
the _private folder, in your case you can use any folder you like to send
the uploaded file to. I overlooked the fact you're trying to write the form
data to an access DB (I presume that's what you're trying to do??) - the
form having a file upload field should upload the file to the folder you
specify.

Anyway, for your info(you may know this already) : the _private is a secure
folder that can't be browsed with an http: request, i.e.. you can't view the
file by putting http://www.yoursite.com/_private/file.txt in your browser -
it won't allow you to view the file, but you can access files from any other
directory - else there'd be no point to putting them on the web if no one
could view them.

My other suggestion stands - your host might only allow certain files such
as text files to be uploaded.
 
G

Guest

Thanks again. I suspect that I have not made it clear that I can upload .doc,
..pdf etc via the csv form handler quite successfully. I do so to an
internally hosted IIS server. It is only when I try the form to upload file
and record other fields in an access database that I fail.

Regards
alan
 
S

Stefan B Rusynko

You should really be using a tool such as ASPupload, if your host supports it, to upload a file and write the file name/location to
a DB
See http://www.aspupload.com/

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Thanks again. I suspect that I have not made it clear that I can upload .doc,
| .pdf etc via the csv form handler quite successfully. I do so to an
| internally hosted IIS server. It is only when I try the form to upload file
| and record other fields in an access database that I fail.
|
| Regards
| alan
|
|
| "Andrew Murray" wrote:
|
| >
| > I think I've confused you and myself; I'm thinking of when you use the form
| > handler to send the data to a text (CSV) file - it writes that text file to
| > the _private folder, in your case you can use any folder you like to send
| > the uploaded file to. I overlooked the fact you're trying to write the form
| > data to an access DB (I presume that's what you're trying to do??) - the
| > form having a file upload field should upload the file to the folder you
| > specify.
| >
| > Anyway, for your info(you may know this already) : the _private is a secure
| > folder that can't be browsed with an http: request, i.e.. you can't view the
| > file by putting http://www.yoursite.com/_private/file.txt in your browser -
| > it won't allow you to view the file, but you can access files from any other
| > directory - else there'd be no point to putting them on the web if no one
| > could view them.
| >
| > My other suggestion stands - your host might only allow certain files such
| > as text files to be uploaded.
| >
| > | > > Thanks for coming back Andrew.
| > >
| > > Uploading to a different folder from _private is successful with any type
| > > of
| > > file when I send results to a .csv file. Why do you suggest that _private
| > > has
| > > to be used? I understand that it is the final "destination" path that is
| > > sent
| > > to the database/csv. But for some reason, when I try to send the form
| > > results
| > > to a database, the file is neither uploaded nor is it recorded in the
| > > database. The form SEEMS to process in that it takes a moment before
| > > clearing
| > > the form. In an attempt to debug, I have added a confirmation form and
| > > error
| > > form. Neither is invoked.
| > >
| > > I feel that it may have something to do with rights on folders or the
| > > database???
| > >
| > > Any help appreciated
| > >
| > >
| > >
| > > "Andrew Murray" wrote:
| > >
| > >> The *location* of the file is sent to the database - the file should be
| > >> uploaded to the _private folder.
| > >>
| > >> Only a guess here, but check with your host that they aren't restricting
| > >> the file types that you can upload. They may only allow, for example
| > >> simple
| > >> ASCII text files i.e. *.csv or *.txt.
| > >>
| > >> I suggest this since you say it works when you choose a csv file but not
| > >> with any other file which makes me think its the file type that is
| > >> causing
| > >> the problems.
| > >>
| > >> What type of file are you trying to upload through the form?
| > >>
| > >>
| > >> | > >> >I want to use a simple form to upload a file to a folder, and at the
| > >> >same
| > >> > time, record a name (by asking the user to complete a text box) and its
| > >> > full
| > >> > pathname (using the BROWSE button on file upload control).
| > >> >
| > >> > When I try to send to a database, the file is neither uploaded nor a
| > >> > record
| > >> > created in the database. However, if I try to snd to a CSV file,
| > >> > everything
| > >> > works as it should.
| > >> >
| > >> > I need the database solution for retrieval, search and other purposes.
| > >>
| > >>
| > >>
| >
| >
| >
 
G

Guest

thanks

quite a neat product. I thnk I will invest.

Stefan B Rusynko said:
You should really be using a tool such as ASPupload, if your host supports it, to upload a file and write the file name/location to
a DB
See http://www.aspupload.com/

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Thanks again. I suspect that I have not made it clear that I can upload .doc,
| .pdf etc via the csv form handler quite successfully. I do so to an
| internally hosted IIS server. It is only when I try the form to upload file
| and record other fields in an access database that I fail.
|
| Regards
| alan
|
|
| "Andrew Murray" wrote:
|
| >
| > I think I've confused you and myself; I'm thinking of when you use the form
| > handler to send the data to a text (CSV) file - it writes that text file to
| > the _private folder, in your case you can use any folder you like to send
| > the uploaded file to. I overlooked the fact you're trying to write the form
| > data to an access DB (I presume that's what you're trying to do??) - the
| > form having a file upload field should upload the file to the folder you
| > specify.
| >
| > Anyway, for your info(you may know this already) : the _private is a secure
| > folder that can't be browsed with an http: request, i.e.. you can't view the
| > file by putting http://www.yoursite.com/_private/file.txt in your browser -
| > it won't allow you to view the file, but you can access files from any other
| > directory - else there'd be no point to putting them on the web if no one
| > could view them.
| >
| > My other suggestion stands - your host might only allow certain files such
| > as text files to be uploaded.
| >
| > | > > Thanks for coming back Andrew.
| > >
| > > Uploading to a different folder from _private is successful with any type
| > > of
| > > file when I send results to a .csv file. Why do you suggest that _private
| > > has
| > > to be used? I understand that it is the final "destination" path that is
| > > sent
| > > to the database/csv. But for some reason, when I try to send the form
| > > results
| > > to a database, the file is neither uploaded nor is it recorded in the
| > > database. The form SEEMS to process in that it takes a moment before
| > > clearing
| > > the form. In an attempt to debug, I have added a confirmation form and
| > > error
| > > form. Neither is invoked.
| > >
| > > I feel that it may have something to do with rights on folders or the
| > > database???
| > >
| > > Any help appreciated
| > >
| > >
| > >
| > > "Andrew Murray" wrote:
| > >
| > >> The *location* of the file is sent to the database - the file should be
| > >> uploaded to the _private folder.
| > >>
| > >> Only a guess here, but check with your host that they aren't restricting
| > >> the file types that you can upload. They may only allow, for example
| > >> simple
| > >> ASCII text files i.e. *.csv or *.txt.
| > >>
| > >> I suggest this since you say it works when you choose a csv file but not
| > >> with any other file which makes me think its the file type that is
| > >> causing
| > >> the problems.
| > >>
| > >> What type of file are you trying to upload through the form?
| > >>
| > >>
| > >> | > >> >I want to use a simple form to upload a file to a folder, and at the
| > >> >same
| > >> > time, record a name (by asking the user to complete a text box) and its
| > >> > full
| > >> > pathname (using the BROWSE button on file upload control).
| > >> >
| > >> > When I try to send to a database, the file is neither uploaded nor a
| > >> > record
| > >> > created in the database. However, if I try to snd to a CSV file,
| > >> > everything
| > >> > works as it should.
| > >> >
| > >> > I need the database solution for retrieval, search and other purposes.
| > >>
| > >>
| > >>
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top