44 replies [Last post]
drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Was this information Helpful?

Hi, I think I have my file downloads set up properly, user can recieve a download and opens up fine the first time (its just a plain text .txt file)

The second time it's clicked, there is an error message :

The following URL is not a valid download link. Please contact the site administrator if this message has been received in error.

But the link downloads fine anyway. Is there any reason for this? I am on a live server, not test.

My files are in a private folder alongside the web root. The dowmload limit is set to never.

thanks for any assistance, much appreciating Ubercart and all the help I have recieved here.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: File Downloads - error message after first download

That is really strange... that error message only gets called when a user is denied access to a file - but it still pops up with a download dialogue box for you?

Are you using the public or private files method? (You need to be on public for the module to function 100%)

That's all I can think of for now.. do your Watchdog logs mention anything about a user being denied, and why?

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Tested, Hapenning in both private and public mode

I have also checked the download limit, it's blank = no limit.

The logs show nothing untoward:

user 05/17/2008 - 01:39 Session closed for user2. user2
uc_file 05/17/2008 - 01:38 The user user2 has ... user2
user 05/17/2008 - 01:38 Session opened for user2. user2
user 05/17/2008 - 01:37 Session closed for superadmin. superadmin
user 05/17/2008 - 01:37 Session opened for superadmin. superadmin
user 05/17/2008 - 01:36 Session closed for user2. user2
user 05/17/2008 - 01:36 Session opened for user2. user2

User2 orders the download... i log in as superuser to switch the order status to complete (I am still just using Credit Card and Test Gateway), log out, log in User2... again, get the download once, then the error mesage, then can download, then the error...it alternates.

Doesnt really mess up the workings of my site but obviously dont want to be spitting meaningless errors at users.

Hope this makes my situation clearer if nothing else! Thanks!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Tested, Hapenning in both private and public mode

Can you make sure your access settings for File Downloads are setup correctly? Just trying to cover all bases...

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: Tested, Hapenning in both private and public mode

Authenticated, Shop admin and site admin (superuser) have download file permission. Not anonymous.

Have tried view all downloads with authenticated both allowed and disallowed, same outcome. hmmm.....?

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: Re: Re: Tested, Hapenning in both private and public mode

Forgive me if this is the equivalent of asking "is it plugged in?" but are you reloading the file downloads page between attempts to download? The download URL is generated anew for each download of the file, so if you download the file and then click on the link again without reloading, you'll get that error message. It's dynamically generated to avoid people being able to leech your file products. But if you're getting that message and people are still getting the download popup, then that doesn't really seem like the problem...

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Tested, Hapenning in both private and public mod

Actually, it's not - the "one-time use only" links are emailed to the customer, but the links in the My Files area are static. The key that is generated for the link (which becomes part of the link) is stored in the uc_file_users table. That's the main part of authentication, along with the uid-fid association.

So, the problem is that it seems to be failing the authentication, while at the same time passing it. It's almost like it's clicking two different links. I'm trying to think of what would cause that... Have you themed or overwritten the function for the user downloads area? are you using the link with a download manager of any type?

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: Re: Re: Re: Tested, Hapenning in both private and public

Hi, I haven't overwritten or themed anything on the site.
I have used both Firefox and IE7 to download the link and get the same message on the page (it's in a red box above the list of downloads just to be specific). Sorry, don't know if any of that's relevant but this is beyond my expertise, such as it is!

You're right though, it does seem to be failing and passing some kind of authentication at the same time.

Just to clarify, I'm using public files method. my temporary directory is set at /tmp in the httpdocs folder, the downloads are served from my private folder alongside the webroot. Is this the recommended setup?

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Re: Re: Tested, Hapenning in both private and pu

That might be a clue - is your temporary folder /tmp configured that way? In other words, is it configured with the leading slash and then "tmp"? If so, that would mean that you are configuring it with an absolute path, which is the normal scenario at least for dedicated servers. If you are on shared hosting, this might cause an issue. My guess is that the issue is not actually with the module itself but with some other server-side config that is just tripping an error, which the uc_file.module doesn't quite understand how to parse.

The next question is for your "private" folder - I don't believe you need to chmod it 777 but that's what I have done with our downloads folder on our dedicated box. Try doing that and see if it changes anything. You might also try the different configs - absolute path vs. relative path. I believe both are acceptable, but absolute path is always recommended. It should be something like...

/tmp (temporary folder)
/var/www/vhosts/example.com/downloads_folder (folder alongside webroot)

Not sure if this is out of your expertise as well - but try tinkering with some settings there, so long as you don't mind changing things. I don't want you to break anything on the site Smiling (But there is (almost) always a fix!)

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: Re: Re: Re: Re: Re: Tested, Hapenning in both private an

hmm, i have tried both public and private system with the following:

tmp (as my temporary folder)
/var/www/vhosts/example.com/private as my downloads folder

the private file is set to 777. is the temp folder supposed to be in the webroot (ie should it located at httpdocs/tmp? or alongside the webroot like the private folder? ( i dont have permissions to create a folder alongside the web root from my shared host accoount, although they altered the open_basedir restriction for me to make my private file writable so i guess they would set up another folder there if necessary.

So I guess what I'm asking is, if I did set my temp folder to /tmp rather than tmp, where is that located?

Hope this makes sense! Still finding the relative/absolute thing a little confusing, thanks for your patience and help.

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
File downloads giving error message every other click

Hmm, still not solved this one. Have moved my site onto production server, everything working ok (so far, i have only tested with a test gateway, will be using PayPal WPS soon). still getting the error message on every other click on a filename in the downloads area of account profiles.

it downloads fine every other time, alternating with the error message "the following URL is nor a valid download link". weird.

Anyone got any ideas? Cheers!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: File downloads giving error message every other click

Are you using Internet Explorer by any chance? Have you tested this in other browsers?

--
Help directly fund development: Donate via PayPal!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: File downloads giving error message every other click

I always develop in Firefox, only use IE for testing. Have tried in IE7 with same results. Like I say, allows the download anyway if I click again - so it works, but probably not instilling a lot of faith in the customer (or my client!) if error messages pop up in the download process.

I suppose if it came to it I could remove the error message from wherever it's being called and print some white space, but that seems a bit dirty Smiling

EDIT

I've just realised this happens only when I try to download the file twice in succession -

e.g. if i download, then go to another page in my account say 'Orders', then go back to 'Downloads', the file is happy to be downloaded again, no error message. SO it only happens if I try to download the file twice consecutively whilst on the 'Downloads' page in 'My Account'.

Does this shed any light? Cheers!

drupalcornwall's picture
Offline
Joined: 05/08/2008
Juice: 43
Re: Re: Re: File downloads giving error message every other clic

Have gone live now, still with (i hope) just this one nagging glitch? Anyone else got any ideas?
Thank you!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: File downloads giving error message every other

One suggestion I have is to edit the headers function of the uc_file.module as per this comment:

http://www.ubercart.org/forum/support/4303/how_user_connects_their_file_...

It's basically changing the headers sent to the browser to be public and cacheable. I think this is mainly a browser issue and has only been observed in IE, but it's worth a shot and shouldn't have any side effects.

--
Help directly fund development: Donate via PayPal!

mennonot's picture
Offline
Joined: 03/05/2010
Juice: 18
Fixing "Access Denied" error from file download links in emails

This is a very helpful diagnostic thread. The user permissions check for "File Downloads" fixed it for me. I guess it makes sense that allowing this for anonymous users is the only way to get links from emails to work.

affinity's picture
Offline
Joined: 08/22/2008
Juice: 39
Same problem, IE& and Firefox

I'm having the same problem. It occurs on each alternate download of the same file from My Account | Files, in both Firefox and IE7. Clears itself once the page has been reloaded, which actually happens when the error message is served.
I tried changing the headers as per previous tip, but no change. Anyone found a solution to this?

I am using the latest version of Ubercart on a Unix shared server with MySql 4.0.27 on 1and1.com hosting.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Same problem, IE& and Firefox

If you had to edit the headers in uc_file_transfer, then I don't think you're using the latest Ubercart. You're having the exact same issues as described above, even with the new code?

--
Help directly fund development: Donate via PayPal!

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Re: File Downloads - error message after first download

Hi, I've been facing similar issue and i tried modifying the headers in the uc_file_transfer function as provided in the thread. But there seems to be no change. It still gives the error message "The following URL is not a valid download link. Please contact the site administrator if this message has been received in error." on consecutive clicks on the file link.

I feel basically the problem lies in the way the file module functions. Onclick of the file link, it calls a javascript function to increment the download count and place it in the last "td". But the value of the variable "accessed" or "$file->accessed" still remains the same as the previous one and so does the download key.

So it requires the page to reload so that it can get the fresh value for "$file->accessed" variable as well as the newly generated key from the db.

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: File Downloads - error message after first download

What browsers are you using to test this? Please let me know if you get the same results in Firefox and Internet Explorer (the latest versions are OK to use).

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Hi, As far as I know, it is

Hi,

As far as I know, it is correct behavior to require a key on the user files page. If this isn't the case, I can easily modify the code to allow no key for user files, but only require one through email.

The reason you can download files successively is because a key doesn't expire until the file is completely transferred. If you start downloading again before the first one is done, you'll be able to sneak it in. I don't know of a way around this currently, without breaking resumed downloading.

In the latest beta, you'll clearly see warnings on the bottom of the page regarding this. Another mess up could potentially be accelerated downloads. See this post for some more info http://www.ubercart.org/forum/support/6671/file_download_limit_not_worki...

Try FreeBASIC!
My game Lynn's Legacy

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Re: Hi, As far as I know, it is

Yes, but i feel there should've been a way where the page could be reloaded at the same time the link is clicked. That wouldn't hamper user experience wherein he/she faces the error message on successive downloads.

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Hi, As far as I know, it is

Sorry, maybe I wasn't clear enough.

The file key will not change until after the file is done transferring. If you refresh the page on clicking, you're just gonna end up with the same key, unless you wait for the file to finish first.

Afaik, there isn't a good way to redirect after the file is complete.

Try FreeBASIC!
My game Lynn's Legacy

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Hi, Apologies for delayed

Hi,
Apologies for delayed reply. I'm using Firefox 3 and IE 6 browsers.

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Hi, I get it what you are

Hi,

I get it what you are trying to say. I even tried to do page reload after the "update" query to update the download key and the "accessed" field. But that doesn't work either.

I somehow wanted to either reload the page after the changes have been done in the database or at least redirect it to a thank you page so that when the user comes back to download the file, the key will be refreshed and so will the "$file->accessed" variable value.

Thanks.

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Hi, I get it what you are

It's complicated. If you increment the key before the user is done downloading the file, you can't allow them to resume the download without returning with an expired key (too liberal), or charging them another download (too conservative).

I think there might be a way to poll from the files screen when a link is clicked, using AJAX and returning a confirmation once the server has expired that key. This would only work if the user has JS enabled, and to be honest, I've never implemented anything like that (in JS), so I'm not sure exactly what kind of code we'd be talking.

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Hi, I get it what you are

I think we're having this issue as well. cha0s, where in the code does the key get updated? I don't recall ever seeing this when I was patching the download manager stuff into the file. But just about every day we get a person saying they have tried to download an incorrect file, and I'm starting to think this is related.

I'll look into it as well and see if I can come up with a solution that works. (The unfortunate part is that I can't seem to reproduce it most of the time...)

--
Help directly fund development: Donate via PayPal!

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Re: Re: Re: Hi, I get it what you are

If you want the steps to reproduce this issue, I could provide it to you. Probably you can do a fresh install and try it out, torgosPizza.
The error message that gets displayed is "The following URL is not a valid download link". Prior to this there is a check made for existence of "$file_download", which is a db object returned from the query to fetch data from uc_file_users table depending on the file id (fid) and the download key.
Since the user comes and downloads the file once, the key gets updated in the db in the function _user_table_action, but since the page is not reloaded, the script does not get the updated key and thus when the user tries to do a successive download, the db object $file_download is "empty" and therefore the message is displayed.
Now since the page gets reloaded to show the message, the key gets refreshed too and thus the user is able to perform the download process at this point.

harsh's picture
Offline
Joined: 01/06/2009
Juice: 12
Re: File Downloads - error message after first download

I think you are absolutely right cha0s, but there should be a way to update the key in the db, finish the download and reload the page too. I hope what I'm saying is fair enough as I'm not so conversant with Ubercart, but its a great module for sure!!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: File Downloads - error message after first download

Okay that makes sense. Now I'm trying to figure out why the key gets updated? Is this related to the feature that allows for "one-time" links that are emailed to users? Perhaps there is a better way to provide these temporary links? My suggestion would be a temp_links table that uses a completely different system, some other type of hash, that is basically an alias for the real downloads. The temp links table would provide a binary status, 0 or 1, which would tell whether or not that first download click was successful (and the download finished). Once this status is 1, any other subsequent downloads through that temp link would fail.

It's kind of a new feature addition but I think it's probably the most surefire solution based on the way the system currently works, and working with our present restrictions.

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: File Downloads - error message after first download

I'm not sure I see the difference between the alias with the binary flag and the current system. In both, downloads are allowed until a 'successful' click (fully downloaded) and then the link expires...

I'm really not sure if there's another way to do this beyond constant polling using AJAX from the client side to know for certain when the download completes, and can then redirect/refresh. I don't know of another way to redirect after a download for instance. Once you're pushing bytes down, you can't change the headers...

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: File Downloads - error message after first download

Well, the difference would be noticeable when the links are emailed to the customer. AFAIK, that's the only instance we have of a "one-use-only" link. (This is separate from a link actually expiring due to a number of clicks or an expiration date.)

So my idea is that instead of emailing the customer the actual links, i.e. http://www.example.com/download/245/jljdf98h23asdnad13, you email them the aliases, which will expire after one click. I realize there is the issue of not knowing when the actual download expires, but I think for an emailed link, that's not really a huge issue. It would just have to be made clear that once the link has been used once, it's expired, and the only way to grab the links again would be through your My Files section.

Does this make sense? I guess I'm still trying to wrap my head around why the keys themselves get changed, if there is a reason other than the expiring of links that get emailed. Thoughts?

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: File Downloads - error message after first downl

Sorry, I've been busy with a move. I think I got what you mean now... I will be looking into this and proposing a patch when I can.

Try FreeBASIC!
My game Lynn's Legacy

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: Re: File Downloads - error message after first d

I've been thinking about this... and I'm not sure which way to take it.

On the one hand, I think it'd be nice to allow users to download files as much as they want from their account/files page... but then, I don't really see the merit of having any email links be a 'one-time-key'.

The download link has two parts, like site/download/%/%. I'm wondering if it might be prudent to simply remove the key altogether, and just use the file ID to serve downloads. We can still count the relevant stuff, like the address, the number of times the file's been downloaded. We might be able to eliminate user confusion greatly if we do that.

I'd like to hear what everyone thinks about this before I commit to changing it.

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Re: Re: File Downloads - error message after fir

Well to be honest I like using the key as a separate form of validation... especially for usage of a download manager which won't have access to the logged-in $user object. However it's easy enough to use the key to verify that the anonymous user is, in fact, downloading a file that has been purchased (as opposed to just spoofing it and validating the download some other way).

In my opinion it'd be better to just eliminate the part of the 'download' case, around line 1518, where the hash gets regenerated and updated as part of db_query. If it's that part of the db call that's causing all of the download links to expire prematurely, perhaps then it's better to find another way of creating the temporary email links. (I think you're right, that maybe they are unnecessary, but it's just one of those ways to keep people from forwarding their email to 50 friends and allowing them all access to the same downloads, especially if anonymous logins are allowed. Of course, people who want to share the links can always just supply their login information, but that's where the "addresses" handler comes in.)

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: Re: Re: Re: File Downloads - error message after

I think that's a good idea, it's the closest I can see of a happy medium between security (having a key) and usability (keys don't expire).

I think as long as every user gets a unique key, then we can rely on the access/address limits to handle the rest. I have a patch here for that, real simple change, and it can take advantage of a changce I've made since then, giving uc_file_users a primary key, making the record storing a bit more efficient.

Input welcome. Smiling

AttachmentSize
uc_file.2.x.patch 589 bytes

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Re: Re: Re: Re: File Downloads - error message a

Any hope for a 1.x version of the patch? Smiling I will gladly take a look at that, seeing as how our site will probably be on 5.x for at least another half a year...

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
No key renewal for 1.x

Your wish is my command!

AttachmentSize
uc_file.no_key_renewal.1.x.patch 955 bytes

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: No key renewal for 1.x

Awesome, thanks. I'll check it out.

In speaking with my partner in crime and coworker, he suggested that perhaps we can continue updating the hash but use different values for it? My idea would be to use the current day's date and the filename. That way, the link will basically get refreshed each consecutive day that it's used. This should still allow for the hash to get regenerated, but will keep it from failing in the cases of concurrent connections, etc.

I know it's probably a little late to be suggesting another solution but I thought I'd throw it out there, since we don't want to get rid of the hash and I suspect the updating feature was put there for a reason.

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: No key renewal for 1.x

IMO, just requiring a unique hash for each customer should be enough security. However, if you think it isn't, it probably wouldn't be too hard to implement something like what you suggested to keep the keys changing, but not get in the way of the customer.

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: No key renewal for 1.x

Right on, I am leaning towards what you are saying. It definitely wouldn't be hard to add into it, especially based on the code that was already there. And actually it wouldn't really be anymore secure that way, since the file link would only change when it gets accessed. A more powerful system might even change those links after a day or something, dependent on Cron, but I'm not sure that'd really be necessary even then.

A lot of things to consider ..

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: No key renewal for 1.x

Well, how about this?

AttachmentSize
uc_file.keygen.patch 1.78 KB

Try FreeBASIC!
My game Lynn's Legacy

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: Re: Re: No key renewal for 1.x

Wow.. sweet. That was fast! If you think it's worthwhile, then perhaps it's worth putting in there. I was happy with just the single hash, but you've taken it to the next level Smiling This way if someone thinks they can put their links on a forum or something, they will fail after the specified amount. It's not a huge thing but it's one of those fixes that will make sharing of files more of a PITA than it's worth.

Also, I'm grateful that you didn't go the hook_cron route. Our uc_file_users table has I think, 1.5 million records in it... just changing the `key` column to `file_key` took about 10 minutes! Anyway, kudos once again. I'll look at patching this up soon.

--
Help directly fund development: Donate via PayPal!

cha0s's picture
Offline
Getting busy with the Ubercode.
Joined: 08/22/2008
Juice: 416
Re: Re: Re: Re: Re: Re: No key renewal for 1.x

Glad you like it! Another possibility would be incresing the granularity of that regen... i.e. setting the frequency at the feature/product level. Anoter possibility would be controlling the regen period, we could use any date() primitive, realistically.

Try FreeBASIC!
My game Lynn's Legacy

Anand yrh's picture
Offline
Joined: 03/06/2009
Juice: 271
I have similar issue, only

I know I am too late to this post, but this could help others as well.

I have similar issue,

only first time the file is downloadable but when user tries to download the same file second time the below error is displayed:
The following URL is not a valid download link. Please contact the site administrator if this message has been received in error.

Instead can I redirect users to another page (custom page with custom error message)?

I have opened a new ticket here. http://www.ubercart.org/forum/support/31107/redirect_if_page_has_error

Thanks,
AnAnD