ftp var for filename with spaces

Hello all,
I am having difficulties writing an ftp script to retrieve a file via get using a variable name to pass the file name.
I know the name of the file I am going to retrieve, this file name has embedded spaces and punctuation in the name itself.
If I interactively use the get and I type in the file name as it exists eclosed into double quotes, then get successfully retrieves the file, yet if I set up a var containing the file name (spaces and everything else that makes up the name), the get is not able to retrieve (expand the var) the file.
I tried with and without quotes, with and without a dollar sign etc ....
Will anybody have some advice for me?
Thanks.

and double quotes?

Yes I tried double quotes, too, no luck.

Can you post your script within code tags?

And using backslashes?
e.g.

var="\ \. \ blah\ "

Here is a sample of what I am trying to achieve:

lfn="This is the long file namelong.PDF"
dirwherefileis=/55
ftp -v ftpservername
.
.
.
cd $dirwherefileis
ls        (this gives me the files and I see my file as one of the listed ones)
get $lfn    (this returns access denied)
get "$lfn"    (this returns access denied)
bye

What is the permission of the file?

Is this actually a shell script or are you typing the commands at a command prompt?

There is a unix command called "get".

just for fun:

ant:/opt/oracle $ touch "This is the long file namelong.PDF"
ant:/opt/oracle $ ll -lt|more
total 4
-rw-rw-r--   1 vbe        dba              0 Feb  3 18:52 This is the long file namelong.PDF
drwxrws--x   4 vbe        dba           1024 Jan 19 15:11 cstat
drwxrwsr-x   2 vbe        dba             96 Jun 30  2009 toto
drwxrwxr-x   5 oracle     dba           1024 Jun 23  2009 oraInventory
drwxrwsr-x   3 oracle     dba             96 Jun 23  2009 product
ant:/opt/oracle $ lfn="This*is*the*long*file*namelong.PDF"  
ant:/opt/oracle $ echo $lfn
This is the long file namelong.PDF
ant:/opt/oracle $ rm $lfn
ant:/opt/oracle $ r ll
ll -lt|more
total 4
drwxrws--x   4 vbe        dba           1024 Jan 19 15:11 cstat
drwxrwsr-x   2 vbe        dba             96 Jun 30  2009 toto
drwxrwxr-x   5 oracle     dba           1024 Jun 23  2009 oraInventory
drwxrwsr-x   3 oracle     dba             96 Jun 23  2009 product

Well I am trying at the ksh prompt for now, when I will have it working I will create a script ......
Thanks.

My good guess!

The unix shell $variable_name substitution will not work at the ftp prompt. The ftp program is not shell and just treats a dollar sign as a character. For shell substitution to work it has to be in a shell script where the substitution takes place first and then the parameters are passed to the ftp program. There are plenty of examples on this website of how to use unix shell "here" documents to feed ftp with parameters.

Hope this helps.