This topic is locked

Replace an image file link to download

8/10/2012 6:40:57 PM
PHPRunner General questions
pasquito author

I am Spanish speaking, so it makes use of google translator.
I am currently using PHPRunner 6.1
I have two drawbacks:
(1) I have a field for uploading files. It is necessary for viewing on webpage to replace the text link with an image. (2) Having achieved this, how could hide the URL to be displayed by placing the cursor over the image?. It can be done with the help of javascript.
I have two applications: (1) the first is for adding information in the database, that includ the upload files (text field in the database, but with the characteristic of type FILE in PHPRunner), (2) the application is just another visit, when I want to show change of the link (file name) for an image (icon of a document).
I have reviewed in the post about it, but the only one that I find no help.

http://www.asprunner.com/forums/topic/17756-help-using-image-for-file-download-link/
In anticipation of its kind solution to this problem.
Sincerely,

Pasquito.

C
cgphp 8/11/2012

Post your code.

R
Rigmantas 8/12/2012

Hi,

Change commonfunctions.php 1131 line:

return '<a href="download.##@ext##?'.$iquery.'"><img src='images/doc.gif'></a>';

Rimantas

C
cgphp 8/12/2012

The link above is for ASP not PHP. The equivalent code is the following:

if($value != "")

{

$value = "<a href='files/" . $value ."'><img src='images/doc.gif'></a>";

}
pasquito author 8/14/2012

Thanks friend Cristian Gile, for the help.
Do not Replace line in file commonfunctions.php 1131.
But with the code you sent in the application of the insert query just formatting options - view as - custom. Works fine.

But what I like now is to hide the link shown (www.abc.com/ ...) to be the mouse over the image. I know there are ways to do this using javascript.
If you could help me would be excellent.

C
cgphp 8/14/2012

But what I like now is to hide the link shown (www.abc.com/ ...) to be the mouse over the image.


Try to reformulate your request.

pasquito author 8/15/2012

Checking the URL that is generated when the field containing the name of this file with the File property of PHPRunner, this format is of the form:
http://www.abc.com/app/download.php?table=rof&field=documento&key1=2
Then considering this, would have the ability to use .. download.php? ... as an option to hide the actual link. What would be the code for it and that property or invention of PHPRunner it would have to code?.
Thanking them for their help.
Atte. Pasquito

C
cgphp 8/16/2012

There are a lot of articles on the web about this topic. Check this one: http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html