|
Actually, I understood you main point and knew you had a typo in your message. I believe we are here as on-line tutors not a programming factory. Thanks for your comment.
|
|
|
|
|
Hi
I am not sure if this is the correct forum category in which to pose this question, but I shall go ahead anyway..if it is not then, please advise..
Could anyone advise me as to how I might, if it is at all possible, define a hyperlink in an HTML document that supports the following characteristics:
1. The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honoured.
2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application.
Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application.
I would like to be able to offer the two options; so that the user can view the target file or launch my application against the file.
Best regards.
James.
|
|
|
|
|
Laing,James wrote: The target is a plain ASCII file that should be displayed in a new window, say for example using WORDPAD or NOTEPAD and not explorer, so that plain text formatting is honored.
Well you can Half do this. You can get a browser to honor the plain text formating by naming the file *.txt (Astrix is wild card) or you can set the headers on the output to a text file. A PHP example is:
<?php<br />
header('Content-type: text');<br />
?><br />
Standard text here.<br />
and Here.<br />
And perhaps even here.<br />
so this tells the browser to render the content as text.
Laing,James wrote: 2. That if the user right clicks the link, a/the popup menu provides the ability to view or 'run' the target; which will be launched by own application.
Note, the filetype, for example '.ABC' of the target, has already been registered/associated with my application.
ok this you can do this IF the application is installed on the clients computer.
Say you had a file you wanted to be rendered as a PDF, well again you use the content you use the Content-Type Headers.
<?php<br />
header('Content-type: application/pdf');<br />
<br />
header('Content-Disposition: attachment; filename="default_filename.pdf"');<br />
<br />
?> <br />
<br />
This will be formatted as a PDF file.....
I hope this is what you wanted....
BTW I am sure that this works with AJAX.
Finally remember that the headers MUST be the first thing sent down to the browser, therefore this will NOT work if anything is sent down before it, including blank lines.
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
|
I need to build a flash animation that gets its data from a Delphi 5 host application. I am pretty sure this can be achieved using the FSCommand from Flash but I dont know how to go about building a small test app to prove this?
Delphi sends flash a value say '5' and then flash uses this to run an animation on the stage and in return tells Host when its completed?
Any tips or tutorials that you guys are aware about please let me know.
Cheers
|
|
|
|
|
Dear All,
how can I prvent user from entering specific pattern such as "1111" , "5555" and "123456789" , usin regular expression control.
In other word I don't want user to repeat the number 4 or 5 times in input box.
Ex: 1111 wrong
5555 wrong
1246 right
Thanks for reply...
|
|
|
|
|
(? <num>\d)(?=\k<num>)){3,}
This expression is true when it finds a number that is repeated at least 3 times.
The number 1111329 contains the number one which is repeated 3 times.
The above expression will not evaluate 111329 to have a match. I have not tested this expression by the way.
George
|
|
|
|
|
|
You want to make a website with the navigation in ajax
(exemple <a href="javascript:LoadPage1()"> page1 </a> refreshing the mainarea of your page to show the right page)
This approch brings a very reactive website but brokes all standards for the users :
Maybe your users want to open your page in a new tab or in a new window
Maybe your users disables javascript
So I give you a very small and simple implentation of a link which :
- Launch a javascript(ajax) method when the user just click on it with javascript enabled
- Make a classic navigate when the user just click on it without javascript
- Make a classic navigate on a new tab/window if the user click on it with :
* the middle button
* CTRL pressed
* SHIFT pressed
-----------------------------------------------------------
<!-- [reusable functions] -->
<script type="text/javascript">
function SmartLink(evt, sender, ajaxJs)
{
var ctrlid = sender.id;
var ctrlhref = sender.href;
sender.href='';
var btn = evt.button;
var IE=navigator.appName=='Microsoft Internet Explorer';
if(!IE){ btn ++ ;}
var classic = false;
if((btn < 2) && (!evt.ctrlKey) && (!evt.shiftKey))
{
eval(ajaxJs);
setTimeout("SmartLinkRestaureHref('"+ctrlid+"', '"+ctrlhref+"')",1);
}
else
{
sender.href=ctrlhref;
}
return false;
}
function SmartLinkRestaureHref(cid, url)
{
document.getElementById(cid).href = url;
}
</script>
<!-- [/reusable functions] -->
<script type="text/javascript">
function MyAjaxLink1()
{
// my ajax method
alert('i can make a ajax call here');
}
</script>
<a id="SmartLink1" href="http://www.google.com" onmousedown="SmartLink(event, this, 'MyAjaxLink1()');">my smart link 1</a>
-----------------------------------
very simple here but maybe a good thing to be packaged
-- modified at 6:12 Wednesday 15th November, 2006
|
|
|
|
|
You do realize this that is not how you post an article?
Welcome to CP BTW
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
it's just a short tip i don't want to post an article with 10lines of javascript lol
|
|
|
|
|
Mmm. but if you post an article then it'll not get lost in the forums...
|
|
|
|
|
ok i will do that
thanks guys
|
|
|
|
|
I’d like to show a 'gallery' of uploaded videos that are available to the user, similar in principle to that shown in windows explorer when viewing a directory of videos.
Not sure how to do it.
I’d like the first frame of a video to be displayed to give some indication of content, and I wonder if anyone knows how to do that without going to the trouble of playing the first frame, capturing it, and displaying it as a static graphic.
Thanks in anticipation.
|
|
|
|
|
Well the first graphic thing may be hard.
The other things are simple, simple store in a database the location of each video, its title and any the information. Then call it from ASP/PHP/PERL/OTHER CGIs/RUBY/FLASH/JAVA/WHATEVER (ok not so much flash or java)
and use the same system you use for displaying any other data, then set a link to open the file path when clicked.
I would say the easiest way to display the image would be to have it uploaded separately.
That being said, it is also an option to have a separate program take the image for you, if you have a dedicated/virtual server you are working from.
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
Thanks.
I have managed to create a gallery, but displaying the thumbnail of each video in the gallery is the question I am chasing, yes.
|
|
|
|
|
You may want to look into WPF / .NET3.0 for this - some fairly good multimedia and graphical capabilities
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
not so much "misinterpret", but just not sure what is .Net3.0, nor am I sure what is WPF .
Soz for being so dumb, but gratefully received answers.
|
|
|
|
|
SexyKitten wrote: Soz for being so dumb
Don't be silly - we all have to start somewhere!
.Net 3.0 is the new version of the .NET framework, which is what all the code that we write (well, most of us) "targets" - it provides "services" exposed as objects that we can use in our own apps, so that we don't have to write all the code ourselves. For instance, the framework provides an Image class, which allows you to (for example) show an image without having to write bytes to a particular area of memory as we used to have to in the olden days.
The new verison has implemented some new technologies which improve on various parts of what we have at the moment - such as Windows Communications Foundation for comms / protocols, WF for "Workflow" type tasks, and Windows Presentation Foundation for graphical stuff.
The best resource for starting out is probably http://www.netfx3.com/[^], which will allow you to download the latest version of the framework, and some tools to help.
The WPF stuff in particular seems to offer an awful lot - from integrated handling of 3D graphics to multimedia etc...for instance, to show a video in a webpage, an example of which can be found here[^].
As with anything techy - there's alot to learn, but if you can get your head around it, it's well worth the effort.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Wow !
The .Net3 looks superb!
Thanks for that. I'll take a look and see if there's any functionality that meets my needs, but it looks like extracting frames is straightforward.
Thanks again.
|
|
|
|
|
SexyKitten wrote: Thanks for that. I'll take a look and see if there's any functionality that meets my needs, but it looks like extracting frames is straightforward.
That's not a problem - here to help (and of course your name "peaked my interest" )
If you have any probs, feel free to post, and I'll see if I can help.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
pItem1Ptr->put_innerHTML(L"");
The code above is to change something in the HTML.
It works well in IE6,I can get the gif picture successfully.
But when I run my code in IE7, this code can't work........and I found that, if I replace c:\\float.gif into http://somesite/somepic.gif It can work nice. So I think there maybe something changed in IE7, can anyone tell me how to show my c:\\float.gif picture in IE7????
|
|
|
|
|
Hi Friends,
I have developed an application in ASP, I Want to project the coding from the client.. that is I Want to Make project as an EXE File
If any one knows tell me dears..
|
|
|
|
|
The client can not view the ASP code, you don't have to do anything to protect the code from the client.
---
b { font-weight: normal; }
|
|
|
|
|
Additionally, you can't make an exe from a website project
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|