Click here to Skip to main content
15,498,797 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Compress a whole folder and all its content on a remote FTP Server with PHP Pin
GoogleBoss27-May-14 0:34
MemberGoogleBoss27-May-14 0:34 
AnswerRe: Compress a whole folder and all its content on a remote FTP Server with PHP Pin
Kornfeld Eliyahu Peter27-May-14 0:49
professionalKornfeld Eliyahu Peter27-May-14 0:49 
QuestionHow do I create a Joomla module? Pin
Brady Kelly24-May-14 4:44
MemberBrady Kelly24-May-14 4:44 
Questionphp view report with paging Pin
Member 825050516-May-14 5:03
MemberMember 825050516-May-14 5:03 
AnswerRe: php view report with paging Pin
thatraja16-May-14 6:32
professionalthatraja16-May-14 6:32 
QuestionPhoto upload using PHP and HTML5 Pin
Jassim Rahma9-May-14 7:40
MemberJassim Rahma9-May-14 7:40 
AnswerRe: Photo upload using PHP and HTML5 Pin
Member 108727482-Jul-14 3:38
MemberMember 108727482-Jul-14 3:38 
AnswerRe: Photo upload using PHP and HTML5 Pin
Weekendrockstar1-Sep-14 8:09
MemberWeekendrockstar1-Sep-14 8:09 
Here is a link that may lead you to an answer you seek.

https://code.google.com/p/html5uploader/[^]

This should allow users of your site to drag and drop a file from their OS to be uploaded to your site in their browser. This will create a button to 'browse' but then they should not have to click an upload button and therefore you should not have to display an upload button.

You can have it save to a 'dynamic' directory/folder by manipulating the save directory in the PHP page that is shown on that site's page. Let's assume that that want files save into a directory named after the user but all user's folders are inside a directory called user_uploads. You will have to set it to an "id" that, obviously, would be unique to each user of your site. If users have a unique username then it could be $username or if they have a unique ID number associated with their account then it could be $user_id.

First change the name of the upload folder to what you want...as described above I am going with user_uploads:

PHP
$upload_folder = 'user_uploads';


Then you would have to do an additional change to the lines shown below to add it to the dynamic folder with the user's unique ID.

PHP
if(file_put_contents($upload_folder/$username.'/'.$headers['UP-FILENAME'], $content)) {
                echo 'done';
        }


For safety's sake I would either create a new directory named with a registering members unique ID upon creation of a new account or at least right before the second code shown to make sure that they actually have an existing directory to download into. Although it might be better to go with the second option here as you may have a lot of members who do not want to upload anything and therefore you could end up with a whole lot of empty directories sitting in that parent directory. Creating the directory (with appropriate permissions to store and show images) right before the upload process could ensure that only those users/members that actually want to upload something will have a folder.

You can download the 3 files plus the .js file from that link above. However, the link to demo this in action appears to be broken. But it's pretty simple and straightforward so it shouldn't take too much work to change a couple variables, upload to your server and test it yourself.

If you have a problem with this then just try searching the web for PHP HTML5 uploading for other possible options.

Many people are working with HTML5, PHP and JQuery to create such things. Just be aware that such things can be dependent upon a user having particular version numbers of particular browsers and you should make note of it accordingly on your site.
QuestionSOAP-ERROR: Parsing WSDL: Couldn’t load from ‘http://domain/index.php/api/v2_soap/?wsdl=1’ : failed to load external entity “http://domain/index.php Pin
Member 77023086-May-14 20:53
MemberMember 77023086-May-14 20:53 
AnswerRe: SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘http://domain/index.php/api/v2_soap/?wsdl=1’ : failed to load external entity “http://domain/index.php Pin
Kornfeld Eliyahu Peter6-May-14 21:35
professionalKornfeld Eliyahu Peter6-May-14 21:35 
GeneralRe: SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘http://domain/index.php/api/v2_soap/?wsdl=1’ : failed to load external entity “http://domain/index.php Pin
Member 77023086-May-14 21:57
MemberMember 77023086-May-14 21:57 
QuestionAdding value to custom column added in ‘sales_flat_order_item’ table Pin
Member 77023086-May-14 20:53
MemberMember 77023086-May-14 20:53 
Questiondestroy session after sometime Pin
Jassim Rahma4-May-14 11:14
MemberJassim Rahma4-May-14 11:14 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 11:24
professionalKornfeld Eliyahu Peter4-May-14 11:24 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 11:51
MemberJassim Rahma4-May-14 11:51 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 11:58
professionalKornfeld Eliyahu Peter4-May-14 11:58 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 12:02
MemberJassim Rahma4-May-14 12:02 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 12:04
professionalKornfeld Eliyahu Peter4-May-14 12:04 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 12:20
MemberJassim Rahma4-May-14 12:20 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 12:21
professionalKornfeld Eliyahu Peter4-May-14 12:21 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 23:01
MemberJassim Rahma4-May-14 23:01 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 23:08
professionalKornfeld Eliyahu Peter4-May-14 23:08 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 23:11
MemberJassim Rahma4-May-14 23:11 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 23:17
professionalKornfeld Eliyahu Peter4-May-14 23:17 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 23:23
MemberJassim Rahma4-May-14 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.