change database when clicking an <a> tag - counter

I am making a download counter. So i have a link, let's say:
rdp_download_31seqs
In my table "files" there is a column "timesdownloaded".
How can I increment this parameter by 1 when someone clicks on the link?
Thank you guys!

You're going to want to start by creating a download file, preferably in php, which will accept a file parameter. An example would be "download.php?file=42.txt". From there the file will update the download count, and fetch the file from the uploads folder.

Related

How can I automate the process of clicking on a hyperlink in an email, downloading the file, and printing it?

Currently I am regularly emailed (through outlook) a list of 20+ hyperlinks in the body of an email, which I open, save, and print one at a time. Right now I use 5 clicks for each hyperlink, which is very inefficient, but I do not know how to automate the process. How should I approach this?
Just some ideas:
Get the selected item using Application.ActiveExplorer.Selection(1)
Load MailItem.HTMLBody into IHTMLDocument object
Loop through all links in IHTMLDocument
Download each link using XLMHTTP
Save the data into a temp file
Create and use WScript.Shell object to launch the "print" verb on the file
Delete the temp file

Renaming file with filepicker.io

Here is my use case: the user will click a "save" link and will be presented with a filepicker.export() dialog, choose a location and name and save a file. Here's the exotic part: I won't have the file yet at that time. It needs to be downloaded first with a GET request, and then stored in filepicker. I won't know which file to start downloading until the user clicks "save".
This can be dealt with by first downloading the file when the user clicks "save", and only then displaying the filepicker.export() dialog. However, I find this cumbersome, since the user will have to wait for the download to finish to be able to choose a filename and location.
It would be much better to allow the user to first make their choice, for example "Dropbox/image.png", and store some sort of placeholder while the download is running: "Dropbox/image.png.part". Later, when the download finishes, I could write the data to the file and rename it to "Dropbox/image.png".
Here are my questions:
Is it possible to append ".part" to the filename that the user chose in the filepicker.export() call?
More importantly, while I know how to write to the file when the download is done, is there any way to rename it? I tried creating a new fpfile object with the same filepicker URL and a different filename, the new filename was ignored (though the write succeeded).
My recommendation would be to first call filepicker.export call on an empty file and allow the user to specify both the name of the file they would like and the location in their cloud storage. When the filepicker.export call finishes, it will pass an FPFile into the callback. From there, you can download any necessary contents you need and do a filepicker.write to save the contents to the location selected by the user.
There shouldn't be any need to rename the file, as the user has already provided the name they want to save the file under during the filepicker.export() call.

Browse file and store file url for uploading it later

I have a form in which you enter some data and you are able to attach files. All I wanna do is have a Browse button so i can select the file and store that file url in some var, so later when i want to submit the form...y can read that var and upload the file using its url. Im using Scala Lift. I search for examples in the web but couldnt find anything helpful. I only want to select the file and store the file url. Can someone help me? Thanks!
You can't store path to file on client's drive. Even if you get path like this, you can't upload file that is not manually selected by client.
I suggest doing AJAX based client.

Joomla, Breezing Forms, QuickMode Form second upload doesn't work

In my form I added two "file upload" elements. Both those elements have permission to upload only one file since information about those files are after form submition are inserted into table. These elements are copy of one another and the only difference is the name.
First file is uploaded successfully and I receive info about it in email, and it's really in folder. Second file is in folder, but filename is incorect, instead of HR_logo.jpg, there is HR_logo.jpg_upload_image_847239430f4e163a379639c7c49422c0_d775f9e424dc81ac736b20294eda1559_flashtmp file
which is identical to "real" (HR_logo.jpg) file.
What am I doing wrong?
Ok, I figured it out.
When I disabled "Use Flash upload" checkboxes for both uploads, I never again encountered that problem.
make sure your field name doesn't contain underscores, then you can use the flashuploader.

How can I simply add a downloadable PDF file to my page?

I want to add a pdf and word format of my resume to my portfolio page and make it downloadable. Does anyone have some simple script?
Add a link to the file and let the browser handle the download.
You may be over-complicating the problem. It's possible to use a href pointing to the location of the .pdf or .doc file, when a user clicks on this in their browser, generally they will be asked if they would like to save or open the file, depending on their OS/configuration.
If this is still confusing, leave a comment and I'll explain anything you don't get.
Create the PDF. Upload it. Add a link.
Save yourself 30 minutes tossing around with PDFGEN code.
You will want to issue or employ the Content-Disposition HTTP header to force the download otherwise some browsers may recognize the common file extensions and try to automatically open the file contents. It will feel more professional if the link actually downloads the file instead of launching an app - important for a resume I think.
Content-Disposition must be generated within the page from the server side as far as I know.
Option:
Upload your resume to Google Docs.
Add a link to the file on your portfolio page just as I do in the menu of my blog:
Use Google Docs Viewer passing to it the URL of the PDF as you can see in this link.