Current location: Hot Scripts Forums » Programming Languages » PHP » File download upload


File download upload

Reply
  #1 (permalink)  
Old 08-12-03, 04:10 AM
Ole Nygaard Ole Nygaard is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Copenhagen, Denmark
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Question File download upload

I urgently need a PHP script where you can:

Download a file and at the same time make it impossible for other to download the same file before it has been uploaded and released by the 'uploader' again.
In this way you can secure that only one can make changes to the file at a time.

I have tried several uploader/downloader and file manager PHP scripts - but none has the above described functionality.

Please help me.....
__________________
Ole :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-12-03, 05:14 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
i suppose one cruel way would be to have the upload script chown the folder to a user like 'ftp', and then once the file is uploaded successfully it changes the ownsership of the folder back to what it was previously. Only problem is the error that the user gets will be a little unfriendly.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-12-03, 05:18 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Aha! Got a better thought!

Why don't you store the file in the database itself (assuming the file isn't huge) and have a column in the database named 'locked'.

then, the upload script would set the value of 'locked' to, say, 1. this would mean that the file itself is locked. the download script could have a bit of code that checks for the value of 'locked' before it starts the downloaded...i.e download if value = 0, or abort if value = 1.

the upload script would basically change the value to 1....upload the file, then change the value back to 0 so it can be downloaded again.

only issue is determining whether or not someone is already downloading the file, but there are ways round that.

i might have time to write the code if you need help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-12-03, 07:23 AM
Ole Nygaard Ole Nygaard is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Copenhagen, Denmark
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Dear kickinhard007

Aha ! ..your last thought sounds very sophisticated!!

But, as I am quite new in PHP programming, I don't have a clue how to make the code.

However, I have already implemented several (more and less) modified PHP scripts on my web server - also including MySQL DB.

...so every help is very much appreciated.

Rgds.
__________________
Ole :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-12-03, 07:47 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
i will try and spare half an hour to write some code for you, bear with me :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-13-03, 03:34 AM
Ole Nygaard Ole Nygaard is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Copenhagen, Denmark
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Dear Kickinhard007

...how are you today ?

I just want to check if you have forgotten me ;-)))) - and I should keep on searching.

(I looked at some of your other brilliant responses yesterday. I must admit that I am quite impressed about you lever of expertise !!)

Rgds.
__________________
Ole :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 08-13-03, 03:43 AM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
howdy ole!

you wouldn't think that i've only been programming php properly for a month! ha ha! i will be writing the code today for you, should have it done by this afternoon!

Thanks for the kind comments, i've been using hotscripts for ages so i thought i'd help out! :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 08-13-03, 04:47 AM
Ole Nygaard Ole Nygaard is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Copenhagen, Denmark
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Fantastic!!

...I don't know if it is relevant - but here is some further information:
- The file, which needs to be uploaded/downloaded, is an EXCEL file.
- Yes, as you described one issue is determining whether or not someone is already downloading the file.
- An other issue is how to regulate that only the 'one' who has downloaded the EXCEL file is also allowed to (modify and) upload it again. You might have a person, which has an old version of the EXCEL file, which just try to upload without knowing that another person has downloaded the file in the meantime....
(Of course you can tell the 'subscribers' - that they are only allowed to upload the file if they are the subscriber who also caused the file to be 'locked' - but I think we all know the level of ignorance user’s might have.....).

...ok, my explanation might not be that good as my language is Danish – not English ;-))) - but hope you got my point.

Rgds.
__________________
Ole :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 08-13-03, 08:06 AM
Ole Nygaard Ole Nygaard is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Copenhagen, Denmark
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Just one more comment:

- I expect the EXCEL file size to be between 100Kb and 500Kb i total.

Rgds.
__________________
Ole :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 08-13-03, 12:00 PM
kickinhard007's Avatar
kickinhard007 kickinhard007 is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Manchester, UK
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
ole, i'm working on the script, but work has been very busy today so i'm going to be delayed until tommorrow.

just thought i'd let you know I haven't forgotten! :-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file download problem ukyankee Perl 6 10-04-03 11:39 PM
Upload and download counting. Arctic ASP 2 08-16-03 11:44 PM
File upload and path to mysql dalio PHP 0 08-12-03 09:24 AM
Upload file type and size limiter! Arctic ASP 1 08-02-03 08:06 PM
php Mirror upload and download software TAK PHP 1 06-25-03 11:31 AM


All times are GMT -5. The time now is 08:56 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.