Home | Advertising Info116 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Friday, March 14, 2025  

Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds



Blog Entry: 3/25/2006 4:50:28 PM

ASPProtect v7 comes with working example code of protecting a file download.

This comes with the system as an example folder with some files in it.

(some of the initial purchaser's of the system might not have that directory.. if that is the case please ask)

Here is how it works...

Basically we protect the file download by only allowing a logged in user to download it. The special ".asp" page we use the stream the file is password protected. It also hides the true location of the file so you can keep your files out of your web or keep them in a folder in your web that does not allow file browsing. Under this scenario even if someone looks at the html source they can not tell where the file really came from and they can only download if they are logged in and you offered them the link to the file.

For the file download protection examples to work you may need to edit some values
in the stream_download.asp file that are valid for your setup.

Look at the source. The values you can edit are commented.

Now, you also need to call a valid "download file name" from the download_link.asp file which is an example of how make a download link to the streamed download.

Lastly, we provide a working example. Now, you obviously may need to customize it to fit your needs. Please realize you are going to have to make special download links in your .asp pages and not only should you only show those links to people with appropriate access to download the files, but you should also protect the streaming download page accordingly as well as far as level, groups, and particular users. What I am saying is which files a particular user is allowed to download is not automatically handled by ASPProtect in any way. We give you all the tools to provide protected downloads to logged in users, but if you have complex needs you’re probably going to need to come up with a system that works for you. It's not really difficult because we did all the complicated stuff, but its something you have to sort out.

Perhaps someday in the future ASPProtect will have an interface to upload files and associate them with certain users. But at the moment it does not.

,

Hi, I have not gotten anything from you about it.

click on the PM button below and send it that way through the forums.

Thanks

,



I am running into problems with the import function.  I have 25 photos loaded into the import folder.  The page see all of the photos.  But after I click on the import process it takes me Picture Manager with no pictures loaded.  I have hit the refresh button, but there is nothing there.  dr_bones38394.676412037,

Not sure because of the nature of the javascript method

 

for starters tighten up the html around the banner call

 

change

 

<tr>
<td width="460" height="60" align="center" valign="middle" class="imagead">
<!------- ASPBanner Ad code ------------->
<script language="JavaScript">
var code = '';
var now = new Date();
var nIndex = now.getTime();
document.write('<s' + 'cript src=" http://www.nababaseball.com/aspbannernet/aspbanner/injectban ner.aspx?BannerZone=1&nocache=' + nIndex + '">');
document.write('</' + 's' + 'cript>');
</script>
<script language="JavaScript">document.write(jscode);</script >

</td>

 

to

 

<tr>
<td width="460" height="60" align="center" valign="middle" class="imagead">
<script language="JavaScript">
var code = '';
var now = new Date();
var nIndex = now.getTime();
document.write('<s' + 'cript src=" http://www.nababaseball.com/aspbannernet/aspbanner/injectban ner.aspx?BannerZone=1&nocache=' + nIndex + '">');
document.write('</' + 's' + 'cript>');
</script>
<script language="JavaScript">document.write(jscode);</script >
</td>

 

 

If that doesn't help I would suggest using the ASP 3.0 version of ASPBanner. It can serve banners to a any type of page extension and it runs just as well as the .NET version. There is a new iframe method for calling banners that you can try instead of the javascript. The iframe method is explained in the ASPBanner Unlimited section of the forum.

cwilliams38150.6443634259,

this could go on forever...

if you want PM "private message" me info to log into your site.. show me the pages we are dealing with...

and I will take a look at it all...

CJW

,

I would look on the pictures folder on the server and see what is there for pictures. Also, when you see a broken X on the site right click and see where it is trying to get the picture from and what the pictures name should be.

I would also be sure to clear out your temporary internet files in IE. clost and restart all browsers..

maybe show me the site ? so I can see this happening ?

cwilliams38348.9748726852,

here is a thread that may help you if this is what you were getting at


http://support.cjwsoft.com/code/moreinfo389-1.htm

,

Okay, this also shows at the bottom of the import/export page

I've got the IUSR account with modify permissions on this data folder as well.  Is the "this directory needs change permission" line just a general reminder?

Files are being stored in "D:\missourirealtor.org\members\aspprotect\data\export\\"

This directory needs change permissions for the anonymouse webserver account.
Those permissions can only be set by your hosting company.
These features will not work without those permissions being set.

 

 

,


IMPORTANT UPDATE - READ THIS
http://support.cjwsoft.com/forum/forum_posts.asp?TID=205& ;PN=1


The IPN Subscription Pack which is built in to ASPProtect 7 contains all the pre-built scripts you need to implement PayPal IPN Subscriptions with ASPProtect. IPN stands for (Instant Payment Notification). It allows you to set up scripts on your server so whenever a PayPal payment is processed the PayPal server sends info to your server regarding the transaction and vice versa. This is a fully automated process and allows you to charge users for access by the month or however long you like.

The Subscription feature of PayPal handles recurring billing automatically. The PayPal server will communicate with the ASPProtect system and keep everything up to date with users and their subscriptions.

This Support Pack basically gives you an additional signup and registration directory "paypal_sub_signup" and it should not interfere with any changes or customizations you have made to your ASPProtect setup. New users can register in this directory and sign up for a subscription at the same time. Existing users whether active or expired can be sent to this directory where they can lookup their account and start a subscription. You can also assign various Access and Group Levels during signup and you can set up various prices for various amounts of time as well. This is a real-time setup for the most part. As soon as a user pays via PayPal your system is updated and they will have access.

To use this all you need to do in ASPProtect 7 is enter your PayPal account name into the settings screen. It will be an email address. You'll need a business or premier account with PayPal and you will need log into your PayPal account and turn on IPN in you profile. They make you enter a default IPN URL. We do not use that so if you already have something there leave it there. If you dont have something there you can type in any the full url to any page on your server. It's probably best to send it to an empty ".asp" page or something.

Changing Payment Options

In the "paypal1.asp" file there are some sample payment options set up.

They look like this and you can have as many as you like.

<!-- Begin Payment Option Code -->
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">

<% Label = "Membership (1 Month) $9.99 Recurring" %>
<!-- Begin Form Fields You Can Edit.. See PayPal Subscription Manual For Details -->
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="a3" value="9.99">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<!-- Field Below must have 2 commas First two values are optional (access level,groups,user ID)-->
<input type="hidden" name="custom" value=",,<% =User_ID %>">
<!-- End Form Fields You Can Edit.. See PayPal Subscription Manual For Details -->

<!--#INCLUDE FILE="form_data_inc.asp"-->
<input type="image" src="https://www.paypal.com/images/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">

</form>
<hr>
<!-- End Payment Option Code -->

 

To really understand what these form values mean it is best to look through the PayPal Subscriptions Manual which is a PDF file you can get from the PayPal Site.

This link was valid the last I checked...
Subscriptions and Recurring Payments Manual

It also may be helpful to use their wizard to create some subscription buttons with different settings and then look at the code generated.


Bascially these are the important ones..

  • a3 - amount to billed each recurrence
  • t3 - time period (D=days, W=weeks, M=months, Y=years)
  • p3 - number of time periods between each recurrence
  • The custom field is something we are using to send info from ASPProtect to PayPal.
    it allows you to set the access_level or groups access (groups support require the ASPProtect Option Pack)

    <input type="hidden" name="custom" value=",,<% =User_ID %>">

    or this example where we are setting the access_level to (2) and also giving the user access to groups (3 and 4)

    <input type="hidden" name="custom" value="
    2,*3*4*,<% =User_ID %>">

    Here is how it works.
    The value setting (red) is essentially and array that can be made up 3 elements separated by comma's

    access_level,groups,User_ID

    If you do not want to set the access_level or groups access.. then you don't even need to edit the setting.

    Values must be separated by a comma even if there is no value and there can be no spaces.  If you didn't want to set an access level or groups there would still be 2 commas at the beginning.  etc etc
    Basically there must always be 2 commas but you only have to set last values which is the User_ID from the ASPProtect system.

    The 1st value is the access level you want to user assigned to.
    The 2nd option is the groups you want the user assigned to. (requires option pack)
    The 3rd option is the User_ID which the system takes care of. Do not edit this option. Leave it as <% =User_ID %>

     

    cwilliams38421.7141782407,

    ok, then I need more information.

    Was the code changed ? Thats the big one. If it worked and now it doesn't something must have changed. Things just don't stop working on their own. I would try putting the original files back in there for everything but the config and dataconn files just to make sure and see and if it works with the original files. (back up your old ones 1st so you can copy them back of course)

    Also, perhaps PM me the site info so I can go look as well.

    ,

    hi,

    no.., not unless you come up with some clever way to handle it on your own
    http://support.cjwsoft.com/code/code_info.asp?TID=369&KW =https
    read 2nd to last post

    The way ASPProtect ships it is designed to either be in http:// the whole time or https:// the whole time.... (there curently is no solution from me allowing going from one to the other)

    sorry

    ,

    The login page sends the user to redirect.asp (which is as follows)

    <%@ LANGUAGE="VBSCRIPT" %>
    <!--#INCLUDE FILE="check_user_inc.asp"-->
     
    <%
    If InStr(Session("Groups"),"*1*") Then
        Response.Redirect("gp01.asp")
    End If
    %>

    <%
    If InStr(Session("Groups"),"*2*") Then
        Response.Redirect("gp02.asp")
    End If
    %>

     

    I am not being redirected to gp02.asp if I am a member of group2.  Also, we wish users who are part of group 2 and 3 to go to a different page (ie. gp2-3.asp)

    Thanks in advance.

    ,

    What other information do you have ?

    Details are very important.

    Info on situations where it works... like OS, browser version.. etc etc

    Info on situations where it does not work... same stuff

    size of the PDF files ?

    server info ?

    Maybe protect a page and offer a PDF file so myself and some of the forum users can try it and report back what happens.

    Also, Many people zip up PDF files when letting people download them as browsers can act pretty odd at times with them. Perhaps that is an option.

    , I think you can either change some things in your PayPal account settings regarding your default currency..

    or add a hidden variable to the PayPal form code ASPProtect uses like this guy did.
    http://support.cjwsoft.com/code/code_info.asp?TID=237&KW =paypal

    The hidden form variable code would go next to all the other hidden variables in no particlar order.. just look through the paypal code in notepad till you find a bunch of those hidden form variables lines in a row. ,

    you have to check the session variables for groups a little differently.. info on that is here

    http://support.cjwsoft.com/code/moreinfo198-1.htm

    ,

    Is there any way to extend the limit multiple login feature to a certain number instead all or none?  In other words, i need to have a user be able to use the same login for x number of people.  My customers are institutions and want to be able to have a single login for however many users they purchase for.

    ,

    glad it is working now

    sorry ya had trouble.

    cwilliams38418.6886342593, Send email to users that are soon to expire:
    What Format should be used for dates and does international friendly dates affect the date as used by the reminder ?

    Am having serious problems with renewal notices and expiration dates.

    All member sign ups are for 1 yr., yet new members are being sent renewal notices.

    Does Paypal use a different date system or has  does Paypal have nothing to do with Subscription dates?


    ,

    Is there an easy way to make this work with reoccurring a monthly or yearly subscription?

    ,

    You should not have single quotes around the "-1" because Album_Active is not a string field in the database. It's true/false or bit field in the database depending on the database you are using (MSSQL or ACCESS)

    I'd do it a little more like this I think.

    SELECT COUNT(Album_ID) AS Alb_Count FROM " & tbl_label_albums & " WHERE User_ID = " & CmdListUsers("User_ID") & " AND Album_Active = 1"

    I took out the parentheses as well since I dont believe they are needed in a simple case like this

    but is hard to say unless your the one testing it... my version might have a mistake as I am a little rusty with my SQL at the moment

    also: in case your wondering...
    depending on the situation and the odbc drivers the 1 and -1 should work either way but sometimes it's picky and you have to do it one way or the other

    cwilliams38433.0564930556,

    When I designed the system I never really intended people to type in long descriptions for pictures

    and if they did I assumed they would use the enter key once in while..

    but I guess people dont do that


    This thread is along the same lines and shows what someone else did about this..

    http://support.cjwsoft.com/code/moreinfo99-1.htm

    though they are talking about a different page its the same issue

    ,

    Is there a way to set various members to upload a limit of photos. So, one member can only upload 5 photos in 1 album and another can upload 30 photos in 2 albums. Even if you just set a permission for the number of uploads for each member.

    Thank you

    , You should email me and I can give you a copy of the original application.,

    you actually dont touch any of those
    UploadDirectory = CmdGetConfiguration("UploadDirectory")
    They get set from the config table in the database which gets edited in the admin area.

    so...

    I am talking about the settings area in the admin area of the applicaton.
    Every setting there is descibed in detail. You get there and change serttings there via the web browser and by logging in as the admin.

    Log in to the online demo as admin and check out the settings area if you are confused.
    http://www.aspphotogallery.com/demo_pro.asp

    ,

    works fine now

    ,

    that wont work the way you did it because groups are not stored like like.

    groups are stored "*1*"
    or "*1*,*9,*"

    so if you test for them you must do so using the InStr function of vbscript

    example:

    If InStr(Session("Groups"),"*1*") Then
        ' do whatever
    End If

    also.. as for the session variable
    it should be    Session("Groups")

    And in Version 6.... (its all ready to go in version 7) that session variable must be saved in the check_user_inc.asp file near where all the others are saved. If it is not there by default "I dont remember if it is or not" you have to add it like so near where all the others are saved

    Session("Groups") = CmdCheckUser("Groups")

    If you are wondering if it is being saved correctly you can always response.write out the Session("Groups") to see if it holds a value

    ,

    Got any info for me on this ?

    Chris

    ,

    Password Retrieval System

    I'm trying to setup the email functionality and have the following settings:

    Email_Component : CDOSYS (Using Remote Server)

    Mail Remote Server: the smtp server in my Outlook account

    Use SMTP Authentication: Checked

    SMTPUsername: the email address in my Outlook account

    SMTPPassword: the password in my Outlook account

    Email Notification: sales@tradersreports.com

    But I get this when I send the request for via missing password info.

    CDO.Message.1 error '80040213'

    The transport failed to connect to the server.

    /aspprotect/scripts/emailing_subs_inc.asp, line 174

    This is running on Windows 2000 server.

    Any ideas?

    Warren

    ,

    no, that system only works with ASP.NET code.

    Currently it can not possibly work with classic asp.
    PayPal made it a nightmare to use and work with.

    Special things regarding the signing of digital certificates also need to be installed on the web server so if it isn't your server your also out of luck.

    ,

    Hi,

    Could you please advise what may be causing this error:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x57a4 Thread 0x5474 DBC 0xf03a704 Jet'.

    /ASPProtect/check_user_inc.asp, line 292

     

    Funny thing is that if I refesh the page with the above error it gives me the following eror:

    /ASPProtect/check_user_inc.asp, line 292

    and after few times of refreshing the page it shows me the page I am after.

    Is this my promlem or ISP's.

    Thank you

    ,

    humm.. their FAQ is interesting...it looks like some sort of .NET configuration issue regarding security policies like you mentioned

    Thats one of the big problems with hosting .NET. Some hosting companies just do do some oddball things. ASPProtect.NET works under default conditions but when hosts go around locking things down to the max there is bound to be trouble. This is the 1st I have heard of this.

    Now, ASPProtect.NET does use the "System.Data.OleDb" and "System.Data.Odbc" which your host says they block because they require full trust.

    All I can really say at the moment is go with a hosting company like www.alentus.com or www.maximumasp.com that does not restrict your .NET abilities so much.

    In the meantime I am going to ask John Evans what he thinks about this.

    ,

    It's real easy actually if ya sniff around the source code.
    ASP is so easy to (work with/edit) even if you dont know any code.


    edit   "save.asp" with a text editor

    change

    If Request("First_Name") = "" Then
      ErrorMessage = ErrorMessage & Server.URLEncode("You must enter a First Name.\n\n")
    End If

    to

    If Request("Company_Name") = "" Then
      ErrorMessage = ErrorMessage & Server.URLEncode("You must enter a Company Name.\n\n")
    End If



    From looking at that save code I dont see where Last_Name was required. The only name I saw required was a 1st name.

    Also.. making the First_Name not required may break something somwhere else. I dont think it will but it might. You are warned.

    cwilliams38326.5102662037, Thank you...I thought I was doing something wrong - and thanks for the tip on the virtual path.,

    Thanks

    It wasn't a complaint. I just bought it last night and installed it today. But, I must have missed the part about requiring Enterprise Manager for installing it on SQL.

    If you want it the link to the Web Based SQL Manager is : http://www.aspenterprisemanager.com/ which is free and the Trialware that I tried is EMS SQL Manager.

    Maybe that will help a little in not requiring that people have an MS SQL license to access their hosted MS SQL to install the software.

    Thanks

     

    ,

    I just did a quick google search... found a ton of info on how to find the setting. Here is one...



    These are directions for IIS6 but the process is similar for IIS4-5

    1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
    2. Double-click your computer name in the left pane, and then double-click Web Sites.
    3. Locate the Web site and directory that houses the ASP application.
    4. Right-click the application site or directory, and then click Properties.
    5. Select Home Directory, and then click Configuration.
    6. Click Options, and then click to select the Enable Parent Paths check box.
    7. Click OK two times.
    cwilliams38148.5822453704,

    one thing to note... the time period we are talking about is going to to be whatever you have the session timeout set at in the settings.

    perhaps making that value lower like 10 minutes is an option for you.. and might help to deal with situation

     

    , Haven't gotten to it yet. I do know there are a few customers using it to edit the app and said it was not all that different. Maybe they will chime in with some tips.,

    The default database password is "temp"

    This is noted in the docs. You can also see the current password by looking at your connection string.

    cwilliams38176.7913888889,

    humm, yea thats a data connection error..
    really not related to the asp code in the application for the most part.

    that is low level


    If using MSACCESS

    I would make sure permissions are set correctly on the database folder (not just the database file itself)

    I would make sure your using at least a 2000 version of the database. 2003-2003 format being better.. 

    I would make sure the server has up to date mdac/odbc drivers.. (that is really the server admins responsibility)


    As for permissions there are articles in our forums about exactly how they need to be set. Improper permissions can cause a ton of random errors like that.

    cwilliams38414.6528240741, and when I go to your now.. its very fast again..,


    Timecard Entry: 3/25/2006 4:50:28 PM

    Seminar, Updated Waite's New Vehicle page w/new photos and hyperlinks, DSL Group, searching for and downloading Mac OS X, and Photoshop 6, Looking for and researching a program that will test our modems, do a report, and possible display good visual statistics., pre-sales meeting w/Dave Mcbride @Fleischer, Jacobe and Associates, Checked email and answered customer's questions., Interview Hall w/Nic, pick up information form clayton office and students from TI. Contact Taylor concrete- fax breakdown to rich once review with Nic Contact heritage cheeese- sign for internet access, Lifetimedocks- left message St. Lawrence radiology- spoke with Kareta- going to review site meet with Doug Sheley- on interns network solutions go over info with lisa Work with interns, have them make copies and do mailing for billing, do work order for pinehurst. Do timecards , Allen Benas - changes to fishing brochure, print out proof, Talking w/ Randall of Nexcom regarding our pricing on long distance., invoices, billing questions in response to callbacks, sign ups, receipts, timecards ,added new people to the excel spreadsheet for the new employees, Answered phones and looked at DU issues, Answered the online issues, Talked to Jim about the continuing probs with the national dialup numbers, The calls that keep coming for the 2360 numbers are unreal. That's the majority of the night, Helping Darrell Move Upstairs, Trouble shoot FP connection for riverside, monday meeting, Admin (emails and organize); Board Minutes, spoke with Ed and worked on Help section of USA1Net site, Softmls update meeting, At Home Working on new CMA code for SOFTMLS2, read and sent emails, Email/Newsgroups, talk to paul, Cleaned, vacummed and mopped. Put new chair together. Took in a few calls, 1 from Andy for me to wake Seth up and repair NS-2 and Square Cam., Watching network. Resetting open modems, etc., paperwork, email, phone calls,

       Active Server Pages Rule The World
    Contact Us  
    All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
    Banner ads ,other site logos, etc are copyright of their respective companies.
    STATS Unless otherwise noted - All Rights Reserved.

    Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com