Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I show a file is checked out?

Posted on 2002-06-19
10
Medium Priority
?
128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
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 200 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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