Re: Save a File from a Text Box
- From: Dymondjack <Dymondjack@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Dec 2008 08:29:01 -0800
Stephen,
Have you verified that the myPath is the full path of the file
("C:\mydir\myfile.txt") and that the mySharePoint location exists?
Fortunately, error 52 (as far as I know) can only be caused by those two
things.
If you would like, I've got functions for both verifying an existing drive
and existing file. I make a habit to explicitly verify both the source and
destination before making any copies.
Maybe you've already got them... let me know if you would like the functions
though.
The file may also be locked by another process, I'm not sure if that raises
a different error or not though.
HTH
-jack
"Stephen sjw_ost" wrote:
Alex, Thank you for your response..
Do you have any examples I can look at? I keep getting errors. I tred to use
the FileCopy for saving to a drive "H:\" but it did not work.
Function Upload()
Dim myPath As String
Dim mySharePoint As String
myPath = Form_f_GetFileandLocation.LocationFile1.Value
mySharePoint = "H:\"
FileCopy myPath, mySharePoint
End Function
The above code gives me
Run-time error '52':
Bad file name or number
I also would definately need an API example to FileCopy/SaveAs to a URL
"http://Intranet" using the path&filename found in
"Form_f_GetFileandLocation.LocationFile1.Value".
Thank you
Stephen
"Alex Dybenko" wrote:
Hi,
I think you can just copy it, try to use FileCopy statement.
For HTTP://Intranet it is more tricky, you have to use API functions to
upload file for HTTP or FTP, much easier if you can also use UNC path and
copy file
--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
"Stephen sjw_ost" <Stephensjwost@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AAAA2503-30EC-4639-8F40-623A72DE58E1@xxxxxxxxxxxxxxxx
I have a Text Box on a Form that contains the full filepath and filename
of
the users choice. How can programically I use the filepath & filename,
from
the Text Box, to save the indicated file to a shared drive (Z:\) or shared
point (HTTP://Intranet)?
Thank you for any help.
Stephen
- Follow-Ups:
- Re: Save a File from a Text Box
- From: Stephen sjw_ost
- Re: Save a File from a Text Box
- References:
- Save a File from a Text Box
- From: Stephen sjw_ost
- Re: Save a File from a Text Box
- From: Alex Dybenko
- Re: Save a File from a Text Box
- From: Stephen sjw_ost
- Save a File from a Text Box
- Prev by Date: Revert to std menus/toolbars during runtime
- Next by Date: Re: Code not working correctly
- Previous by thread: Re: Save a File from a Text Box
- Next by thread: Re: Save a File from a Text Box
- Index(es):
Relevant Pages
|
Loading