Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New FAQs 4

Status
Not open for further replies.

craigsboyd

IS-IT--Management
Nov 9, 2002
2,839
US
I've never been one to write FAQs in this forum, but decided to finally do so and I am providing a list of these FAQs below. I wish the FAQ area had a way to show which FAQs I've read and which ones I haven't. Seems like I miss new FAQs that other members have posted unless I carefully scan the whole list. Wish the FAQs worked like the threads...I can see in the threads list if there is new content or not. I am providing this list of my FAQs so other members will know they are there now, and if you ever create a new FAQ or Edit an existing one, please start a thread on it so myself and others can go check it out. Thanks.

[ol][li]Multiselect Records in a Grid - Basic Example
faq184-3831[/li]
[li]Incremental Search - Like Help Index
faq184-3842[/li]
[li]VFP Chat Client
faq184-3883[/li]
[li]Microsoft's Mappoint - Create a Datamap
faq184-3886[/li]
[li]How to create ZIP Files with VFP
faq184-3830[/li]
[li]Add Download Ability to Your App in 2 Seconds
faq184-3838[/li]
[li]Commandbutton picture in any position
faq184-3837[/li]
[li]API Structures & Pointers - Get Host & IP Example
faq184-3854[/li]
[li]Email/Website Hyperlinks on a Form
faq184-3889[/li]
[li]Build a .NET DLL and use it in VFP
faq184-3836[/li]
[li]Send email with attachment using JMail
faq184-3835[/li]
[li]Associate your VFP app with a specific file extension
faq184-3839[/li][/ol]

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
I use this '8.' link as answer in thread thread184-601351
and got the star. This star is for you.

Zhavic



---------------------------------------------------------------
In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
 
Another new addition to my FAQ list:

Webcam Video Capture
faq184-3891

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Hi,
Good work
I have a question about '6'.
If the ftp site ask for username and password how can i do?
Thank you
Marius
 
MACHELE

Most likely the password would be issued at connection time rather then at download time.

Code:
DECLARE INTEGER InternetConnect IN wininet;
		INTEGER hInternetSession, STRING  sServerName,;
		INTEGER nServerPort, STRING  sUsername,;
		STRING  sPassword, INTEGER lService,;
		INTEGER lFlags, INTEGER lContext
hFtpSession = InternetConnect (hOpen, strHost,;
		INTERNET_INVALID_PORT_NUMBER,;
		strUser, strPwd,;
		INTERNET_SERVICE_FTP, 0, 0)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
slighthaze
About 11:
Why didn't you showed an example of how it receives mails too? I think it's posible to do this.
A star you surely deserve from me.
Regards

As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
 
machele,

Usually if a site requires a username and password you will be prompted for them at the time of the download. Otherwise, if you want to hardcode them you can

use username...
sURLandFile = "ftp://username@ftp.microsoft.com/deskapps/readme.txt"

use username and password...
sURLandFile = "ftp://username:password@ftp.microsoft.com/deskapps/readme.txt"

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Machele,

Looks like tek-tips has freaked out on the posting I made...it should read

Code:
sURLandFile = "ftp://username@ftp.microsoft.com/deskapps/readme.txt"

sURLandFile = "ftp://username:password@ftp.microsoft.com/deskapps/readme.txt"


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
ShyFox,

I'll see what I can do when I find some time. Thanks for the suggestion and the star. :)

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
FYI: Dave Murphy, CEO of Tek-Tips Forum, agrees with us that the FAQ's are too hard to keep up-to-date with, and he and the technical director are considering ways to promote new FAQ's.

In the meantime, the only way that works are threads like this one....

So, everybody, Keep the FAQ's coming!!
 
I use :

Local sURLandFile, nRet

sURLandFile="ftp://username:password@name.domain.ro/aa.exe"

Declare DoFileDownload IN shdocvw.dll STRING lpszFile

nRet=DoFileDownload(STRCONV(sURLandFile,5))


And i received an error:

"Internet explorer cannot download file.exe??....." and some strange characters.
Why?
Thank you
Marius
 
machele,

Tek-tips did something strange when I posted that, I reposted see above...or maybe you posted something normal and tek-tips did it to you too? I don't understand why it does all that target stuff and messes the url up. (You can uncheck "Process TGML" before you post or put
Code:
around the link I guess.)

I have changed the FAQ so you can see what you should do, look towards the bottom at the comments.

Your code should read...

Local sURLandFile, nRet

sURLandFile="ftp://username:password@name.domain.ro/aa.exe"

Declare DoFileDownload IN shdocvw.dll STRING lpszFile

nRet=DoFileDownload(STRCONV(sURLandFile,5))


If this doesn't work then I would verify that the ftp server is up, that you have the correct username and password, and if all else fails try to download it from another FTP client jsut to make sure that everything is working. Those are just a few ideas off the top of my head. Without knowing the username, password, and site that you are using I can't test it at my end. Please post back here and let me know what you find out. Thanks.


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
If in the browser i write:
ftp://username:password@name.domain.ro/aa.exe
it works
Thank you
Marius
 
I think is something wrong on this site.
I want to say if in the internet explorer i put at the adress "ftp://username:password@name.domain.ro/aa.exe"
it is working.
Why
Thank you
Marius
 
ShyFox,

It appears that you have to purchase the Professional version of JMail for the Pop3 functionality to work. These functions are needed in order to receive emails. That having been said...I have looked at the object model extensively and can theorize that the following code will work to download email messages and their attachments, if you were to own the professional version. (Freeware version is only for sending email and attachments.)

LOCAL oPop3, oMessages, nMsgCount, nCounter
LOCAL oMsg, oAttaches, nAttachCount, nCounter2, oAtt

oPop3=CREATEOBJECT("jmail.pop3")
oPop3.connect("username","password","mail.somehost.com")
oPop3.DownloadMessages()
oMessages=oPop3.Messages
nMsgCount=oMessages.count()
FOR nCounter = 1 TO nMsgCount
oMsg = oMessages.Item(nCounter)
?oMsg.Date
?From
?FromName
?Priority
?Subject
?Body
oAttaches = oMsg.Attachments
nAttachCount = oAttaches.count()
FOR nCounter2 = 1 TO nAttachCount
oAtt = oAttaches.Item(nCounter2)
? oAtt.ContentType
? oAtt.Size
=STRTOFILE(oAtt.Data,oAtt.Name)
ENDFOR
ENDFOR


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
machele,

I'm don't know exactly what is happening that is not allowing you to download from that ftp site. I wish I could run some tests and stuff, but I don't know the site, the username or the password you are using (and for very good reason - sensitive data). I can tell you that I have used this control myself on many different FTP and HTTP sites and haven't had a problem as long as I had permissions, the correct username and password, and the correct address. I know this doesn't help you much. Very strange that internet explorer would work for you in downloading but not this since this is the very same download dialog that internet explorer uses (the default one anyways - I say this because there are so many download accelerators and such that can be integrated with IE). If you figure anything else out on this let us know.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Slighthaze,
I tried the code on many ftp sites.But the same error.
Thank you
Marius
 
machele,

I hadn't realized that you were getting an error. What exactly is the error you are getting?

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
The error is:
"Internet explorer cannot download file.exe??....." and some strange characters.
Thank you
Marius
 
I think that the name of your file or the path has unsafe URL characters that need to be turned into escape sequences (unsafe characters such as spaces in the path or file name)...a guess at this point given your reference to some "strange characters". So let's expand on the FAQ and see if we can get it to work for you. (cut-n-paste the code below and change the URL to whatever it is you're trying then run it)

Code:
Local sURLandFile, nRet

Declare DoFileDownload IN shdocvw.dll STRING lpszFile 

sURLandFile="ftp://username:password@domain/Some Path/Some File I Want.zip" &&the path and filename have spaces in them

sURLandFile = HandleUnsafeChars(sURLandFile)

IF !EMPTY(sURLandFile)
	nRet=DoFileDownload(STRCONV(sURLandFile,5))
ELSE
	MESSAGEBOX("Function returned an empty length string.",16,"Something is Wrong")
ENDIF

************************
FUNCTION HandleUnsafeChars(sAddressUrl)
************************
	#DEFINE ICU_BROWSER_MODE 33554432 && 0x2000000 

	DECLARE INTEGER InternetCanonicalizeUrl IN wininet; 
	    STRING sURL, STRING @sBUFFER, INTEGER @nLength, INTEGER nFlags 

	LOCAL sNewUrl, nResult 

	nResult = 250 
	sNewUrl = Replicate(Chr(0), nResult) 

	IF InternetCanonicalizeUrl (sAddressUrl,@sNewUrl, @nResult, ICU_BROWSER_MODE) <> 0 
		RETURN Left(sNewUrl, nResult)
	ELSE
		RETURN &quot;&quot;
	ENDIF 
	
ENDFUNC &&HandleUnsafeChars

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top