Page 1 of 2
One click publishing
Posted: Mon Aug 23, 2010 2:29 pm
by bsouthuk
HI
Wonder if someone can help me.
I have developed an application which is updated very frequently, so when customers open the standalone app I have sent them it downloads the stack file everytime they double click my app which sits on their desktop.
Its just one line of code:
go url "
http://mydomain/mystacks/portal.rev"
This works fine however, my stack is 18 MB so my customers are having to wait around 1-2 minutes before my applicaition opens therefore i'm uploading my stack compressed:
put compress(tPathToMyStackFile) into tCompressedStackData
put tCompressedStackData into url \
"
ftp://user:password@ftp.mydomain.com/my ... tal.rev.gz"
I have checked my web portal and the stack.gz file is there but it isnt opening when using the following script:
get url "
http://mydomain/mystacks/portal.rev.gz"
go decompress(it)
Does anyone know what I am doing wrong?
Thanks
Daniel
Re: One click publishing
Posted: Mon Aug 23, 2010 3:24 pm
by FourthWorld
Hello Daniel -
I'm a bit overdue getting back to you on your post to the improve-rev list, but I've been working on a library to help your work along so the time has been well spent. This week is a bit impacted with some client deadlines, but with any luck I should have some scripts for you early next week. Feel free to call me in the meantime if you like: 323-225-3717.
In the meantime, to diagnose what's happening in your scripts you may want to check "the result" after your commands. The result will be empty after successful calls, but usually contains error info for those that have trouble.
E.g.:
Code: Select all
put compress(tPathToMyStackFile) into tCompressedStackData
put tCompressedStackData into url \
"ftp://user:password@ftp.mydomain.com/mystacks/portal.rev.gz"
if the result is not empty then answer the result
Re: One click publishing
Posted: Mon Aug 23, 2010 3:49 pm
by bsouthuk
Hi Richard
Thank you very much for your help it really is most appreciated.
The error message I am getting when geting the url and decompressing it is 'no such card'
Not sure why it comes back saying this?
Re: One click publishing
Posted: Mon Aug 23, 2010 4:09 pm
by Klaus
Hi Daniel,
looks like you only compress the string in the variable "tPathToMyStackFile"
and upload that to your server!
You need to use "binfile":
Code: Select all
...
put compress(url"binfile:" & tPathToMyStackFile) into tCompressedStackData
put tCompressedStackData into url \
"ftp://user:password@ftp.mydomain.com/mystacks/portal.rev.gz"
...
So no valid stack file is in the compressed archieve ergo: no such card!
Best
Klaus
Re: One click publishing
Posted: Mon Aug 23, 2010 4:10 pm
by FourthWorld
I'm assuming you're getting no error with the decompress function, which would normally throw an execution error if the data being passed to it is not complete compressed data. That much is good. But now we have to figure out how the seemingly-successfully-compressed data is not recognized as a stack file.
Instead of using "go", perhaps you could replace that with:
put it into url ("binfile:"&specialFolderPath("desktop")&"/TestStack.rev")
...and then see if you can open it in Rev. That would at least let us know if the file is good stack data.
If that doesn't work out, perhaps there was an issue uploading (though I'd suspect that a problem on that end would throw an error when you try to decompress it). Maybe adding a check on the result after the upload statement as I showed above might tell us something useful.
Re: One click publishing
Posted: Mon Aug 23, 2010 4:11 pm
by FourthWorld
Looks like Klaus caught it. My bad, since you were using the example I posted pre-coffee to the improve-rev list.
Thanks, Klaus.
Re: One click publishing
Posted: Mon Aug 23, 2010 4:25 pm
by bsouthuk
Thanks Klaud but unfortunately still getting same problem. Coming back saying 'No such card'
Richard - I have tried what you suggested:
'Instead of using "go", perhaps you could replace that with:
put it into url ("binfile:"&specialFolderPath("desktop")&"/TestStack.rev")'
This saves the stack to my desktop, however when I try to open it, a message appears saying 'This is not a stack file'. Very strange.
When i upload to my server using the 'if the result is not empty then answer the result' script, no errors appear so I am completely bamboozled!
Re: One click publishing
Posted: Mon Aug 23, 2010 4:31 pm
by FourthWorld
See Klaus' post above. He caught an error in my original script which failed to use the "binfile" directive for specifying that you're after a file and not the variable itself.
Re: One click publishing
Posted: Mon Aug 23, 2010 4:47 pm
by bsouthuk
Hey Richard
Yes I tried that but hasnt made any difference. Still saying no such card
Re: One click publishing
Posted: Mon Aug 23, 2010 4:54 pm
by bsouthuk
Though what I do know is that it isnt compressing and uploading correctly as the 'compressed stacl' thats uploading to my server is always the same size: 38KB regardless of how big the stack actually is
Re: One click publishing
Posted: Mon Aug 23, 2010 4:55 pm
by FourthWorld
Right. Klaus' post explains it all. Really. Make the change he suggests and I suspect your code will work well.
Re: One click publishing
Posted: Mon Aug 23, 2010 5:12 pm
by bsouthuk
Sorry Richard but I have tried this and still the same problem.
The stack is clearly not compressing and uploading even after Klaus' changes. The stack on my server is always the same size at 38KB regardless of the size of the stack.
I have looked hard at the script:
Code: Select all
put compress(url"binfile:" & tPathToMyStackFile) into tCompressedStackData
put tCompressedStackData into url \
"ftp://qgloginc:manutd07@ftp.qglogin.co.uk/public_html/boo1.rev.gz"
Looks fine to me - i'm hoping it has nothing to do with me using Windows 7!
Re: One click publishing
Posted: Mon Aug 23, 2010 5:24 pm
by Klaus
Hi Daniel,
hmmm, try this one (see the additional parenthesis around "binfile:"!):
...
Code: Select all
put compress(url("binfile:" & tPathToMyStackFile)) into tCompressedStackData
answer the result
## is empty if everythings worked out fine and
## might give a hint what might have been wrong otherwise?
...
Best
Klaus
Re: One click publishing
Posted: Mon Aug 23, 2010 6:11 pm
by bsouthuk
Thanks for your help Klaus but still the same probem.
When adding the extra parenthesis the problem still persists. Now I have:
Code: Select all
put compress(url("binfile:" & tPathToMyStackFile)) into tCompressedStackData
put tCompressedStackData into url \
"ftp://qgloginc:manutd07@ftp.qglogin.co.uk/public_html/boo.rev.gz"
answer the result
The result is empty so no errors are showing.
Do you think its worther reporting the problem to RunRev?
Re: One click publishing
Posted: Mon Aug 23, 2010 6:35 pm
by Klaus
Hi Daniel,
well, I wrote and meant to check the result right after the COMPRESSING,
since the uiploading obviously works!
...
put compress(url("binfile:" & tPathToMyStackFile)) into tCompressedStackData
answer the result ## !!!
put tCompressedStackData into url "
ftp://qgloginc:manutd07@ftp.qglogin.co. ... boo.rev.gz"
...
I do not think this is a Rev error, I have been using this technique for yearts and never had problems!
There is something going wrong on your side, I'm afraid.
Best
Klaus
P.S.
Try to do everything on your HD first, I mean:
1. compress your stack
2. save the compressed data to a file
3. decompress the resulting file from 2. and
4. save the decrompressed file to your HD and check if you
5. can open that file with Rev