Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postNetText

8 views
Skip to first unread message

ooi

unread,
Mar 7, 2009, 10:36:21 AM3/7/09
to
Dear Sir/ Madam

Please guide me for below script.

on mouseUp me

myurl="www.its-solution.com/sample.txt" --// this is the file that i want
to place text name mytext

mytext=["ooi"]
netID = postNetText(myurl,mytext)

put netError(netID)
put netTextResult(netID)

if netDone(netID) then
member("text").text = netTextResult(netID)
end if


end

unfortunately the netError is "1" and refer to the possible error codes means
Occurs when the local path points to a directory which doesn't exist

Any idea. Thanks Thanks

Mike Blaustein

unread,
Mar 7, 2009, 11:02:09 AM3/7/09
to
There are a few things wrong here. One is that you are using
postNetText when getNetText would be more appropriate. You are not
posting anything....

Next, is that you should preface your web address with "http:\\"

Third is that the net operation is asynchronous. It will not retrieve
the text immediately, so when you have the "if netDone (netID) then"
line, it will ALWAYS evaluate to false. It will never be done by the
time you are doing it. You should put that bit into a different handler
that is constantly being monitored.

Like this:

--snip--
property pNetID

on mouseUp me
myurl="http://www.its-solution.com/sample.txt"

pNetID = getNetText(myurl)

put netError(pNetID)
put netTextResult(pNetID)

end

on enterFrame me
if netDone(pNetID) then
member("text").text = netTextResult(pNetID)
end if
end
--snip--

ooi

unread,
Mar 7, 2009, 11:53:27 AM3/7/09
to
Thanks for your comment.

my intention is to over write the TEXT in the file name
"http://www.its-solution.com/sample.txt". postNetText.

I have no problem to retrieve the TEXT in
"http://www.its-solution.com/sample.txt" by using getNetText.

also mean i want to post the string text "abc12345" into the file
"http://www.its-solution.com/sample.txt". But my postNetText not working.
Please advice. Thanks

Mike Blaustein

unread,
Mar 7, 2009, 12:07:33 PM3/7/09
to
You would typically use a server side script to do this. You can not
change the contents of a file on the web with postNetText. That is not
what it does. If you had, for example, a php script that you could post
to and it would take that input and put it into a database or something,
then you would use postNetText. Can you imagine the chaos if anyone
could post anything they want to any text file on the internet? Bear in
mind that HTML files are really just text with markup. I would be able
to change any HTML page I want to whatever I want. Obviously that would
be bad news, and thus you can not do what you are asking for. There are
other xtras that let you upload files to a server that you have write
access to, for example DirectFTP can log into an FTP site and upload a
file. So if your website has FTP access (and most do), then you can use
it to set the text file.

ooi

unread,
Mar 7, 2009, 1:11:30 PM3/7/09
to
Thanks Thanks. Im clear now. Actually i just place an order to puchased the DirectFTP for that function. I thing the problem can be solved. Anyway thanks for your technical comment. Thanks

Sean Wilson

unread,
Mar 7, 2009, 3:09:01 PM3/7/09
to
> Actually i just place an order to puchased the DirectFTP for that function.

If you want an xtra that can manage FTP access, I would rather recommend
ShockFiler - much better support and on-going development.

Cherax79

unread,
Mar 10, 2009, 8:45:04 AM3/10/09
to
[q][i]Originally posted by: [b][b]ooi[/b][/b][/i]
Thanks for your comment.

[/q]

I see where is the problem.
You do not understand getNetText and postNetText methods.
getNetText means "execute" php or other script using method GET
postNetText means the same but using method POST
get doesn't mean "read" and
post doesn't mean "send".

If You want to write some data to file on external server you should use php
script which will handle the file.

0 new messages