Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
File upload / download question
Old 01-26-2011, 10:42 PM File upload / download question
madnhain's Avatar
Experienced Talker

Posts: 42
Name: Jez
Location: Grand Junction, CO / Williston, ND
Trades: 0
Greetings!
on my site, I have a form for clients to send detailed instructions for projects that I am working on. This information is stored in a mysql db so I can go in and look at the current project information.

What I'm attempting to do is allow users to upload files that need worked on... this file could be anything from an image that needs altered to a spreadsheet. I need to be able to accommodate every file type.

I'm able to store these files in as a BLOB, but am having a heck of a time retrieving and downloading them. I've found very little helpful information about file handling with mysql.

Any help on this would be great! a shove in the right direction!

Also, I was wondering if perhaps simply uploading the files and saving them to the server would be a viable approach? certainly would be simpler. If I did that, would there be security issues involved with people uploading potentially malicious files?

Thanks!
madnhain is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-26-2011, 11:41 PM Re: File upload / download question
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
In my opinion, storing binary data in a db is usually hard to work with and sometimes cause corrupted data. I would upload the file in a ftp location or above public root location or inside public root with htaccess blocking access. You can save the path location to the db and use ftp or readfile() to serve as a download link.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 01-27-2011, 10:20 AM Re: File upload / download question
madnhain's Avatar
Experienced Talker

Posts: 42
Name: Jez
Location: Grand Junction, CO / Williston, ND
Trades: 0
Thanks for that. a follow-up question:

If I have the files uploaded to a higher location, is there an elegant method of viewing and displaying the contents of that upload directory while linking the file names to the client / project it is related to?

or better yet, when I list the active projects, each project would have a link to the appropriate file?

Thanks!
madnhain is offline
Reply With Quote
View Public Profile
 
Old 01-27-2011, 10:57 AM Re: File upload / download question
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
By using the native dir() class you can read the directory contents and provide links
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to File upload / download question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33241 seconds with 12 queries