Solved

How do I show a file is checked out?

Posted on 2002-06-19
10
124 Views
Last Modified: 2013-12-24
I'm using cffile to upload files to a folder, and I am writing the data on the files to a db table.

Now I want to institute some kind of check in, check out system for the files.  Does anyone have any ideas on how I should do this?
0
Comment
Question by:g118481
  • 4
  • 4
  • 2
10 Comments
 
LVL 5

Expert Comment

by:nathans
ID: 7093520
You are going to shoot me but why do not add a field for the id of who checked it out and make it 0 when it is checked back in.  This way you will know who checked out the file as well as the fact it is checked out?

Plus that way you can have an admin who can see if the person who checked out the file is on vacation or left work without checking it back in... they can then check it back in.

Is this what your wanting? or something more?

0
 
LVL 1

Author Comment

by:g118481
ID: 7093558
nathans,

You raised a very good point.
I will have to work on that aspect after I get my primary task figured out

Which is, how do I or what mechanism do you suggest I use to check out the file?  Right now in test I have a link to the document, and they would be able to download this document there.  Also, the update(edit) form allows them to update an existing document.  How can I write a 1 or 0 to the checked out field, and then the checked in field?  How will it know?
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7093572
what is the purpose of this.. do you want to lock down a file completely when a user has downloaded it until they upload/update it again or just for the duration of the upload/update.

CJ
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:g118481
ID: 7093579
yes, I need to be able to lock the upload/update function when someone is working on a document.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7093618
I am assuming that the site requires authentication?

CJ
0
 
LVL 5

Expert Comment

by:nathans
ID: 7093779
Sorry to sound bad but do you know how to update a database using SQL?

If so then simply

<cfquery name="qry" datasource="dsn">
update mytable
Set
  Checkout=1
</cfquery>

Done... now don't allow downloads of the ones with Checkout equal 1


On upload of the new version...

<cfquery name="qry" datasource="dsn">
update mytable
Set
  Checkout=0
</cfquery>

Done... now allow downloads of the ones with Checkout equal 0


Am I missing something? or is this the answer? or do you need more?  Are you meaning in Studio or from your web App?





0
 
LVL 1

Author Comment

by:g118481
ID: 7093939
cheekycj,

yes, the web app will do authentication for upload/update of files.

nathans,

my question is based more around the framework for applying this procedure to the web app.

The obstacle I need to overcome is how will the db table know the file has been downloaded?  At first sight this may be a silly question to you.  However, listen to this scanario.

The user can click on a link to each file and download it. Then they can go to the upload page and upload or update that same document without ever checking it out.

How do I place a query to change the new field (checkout) in the table to checked out when the user clicks on the link to the file?  The links are simply a listing of the files in the repository that have been uploaded.

How do I overcome this?
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 7094016
you will have to trigger the DB update when the file is downloaded.

your links will be like:

<a href="checkout.cfm?file=filename.doc">Click to download</a><br>


checkout.cfm will look like:

<cfif isdefined("URL.file")>
    <!--- put query here to update flag to check out file --->
    <CFHEADER NAME="Content-Disposition" VALUE="filename=#URL.file#">
    <cfcontent type="attachment" file="/path/to/downloads/#URL.file#">
</cfif>

Does that make sense?

CJ

0
 
LVL 1

Author Comment

by:g118481
ID: 7094085
cheekycj,

your framework works perfect.
thanks for your time.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7096258
Glad I could help and thanx for the "A".

CJ
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question