Click here to Skip to main content
15,884,007 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
GoogleBoss26-May-14 23:34
GoogleBoss26-May-14 23:34 
AnswerRe: Compress a whole folder and all its content on a remote FTP Server with PHP Pin
Kornfeld Eliyahu Peter26-May-14 23:49
professionalKornfeld Eliyahu Peter26-May-14 23:49 
QuestionHow do I create a Joomla module? Pin
Brady Kelly24-May-14 3:44
Brady Kelly24-May-14 3:44 
Questionphp view report with paging Pin
Member 825050516-May-14 4:03
Member 825050516-May-14 4:03 
AnswerRe: php view report with paging Pin
thatraja16-May-14 5:32
professionalthatraja16-May-14 5:32 
QuestionPhoto upload using PHP and HTML5 Pin
Jassim Rahma9-May-14 6:40
Jassim Rahma9-May-14 6:40 
AnswerRe: Photo upload using PHP and HTML5 Pin
Member 108727482-Jul-14 2:38
Member 108727482-Jul-14 2:38 
AnswerRe: Photo upload using PHP and HTML5 Pin
Weekendrockstar1-Sep-14 7:09
Weekendrockstar1-Sep-14 7: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 19:53
Member 77023086-May-14 19: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 20:35
professionalKornfeld Eliyahu Peter6-May-14 20: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 20:57
Member 77023086-May-14 20:57 
QuestionAdding value to custom column added in ‘sales_flat_order_item’ table Pin
Member 77023086-May-14 19:53
Member 77023086-May-14 19:53 
Questiondestroy session after sometime Pin
Jassim Rahma4-May-14 10:14
Jassim Rahma4-May-14 10:14 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 10:24
professionalKornfeld Eliyahu Peter4-May-14 10:24 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 10:51
Jassim Rahma4-May-14 10:51 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 10:58
professionalKornfeld Eliyahu Peter4-May-14 10:58 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 11:02
Jassim Rahma4-May-14 11:02 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 11:04
professionalKornfeld Eliyahu Peter4-May-14 11:04 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 11:20
Jassim Rahma4-May-14 11:20 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 11:21
professionalKornfeld Eliyahu Peter4-May-14 11:21 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 22:01
Jassim Rahma4-May-14 22:01 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 22:08
professionalKornfeld Eliyahu Peter4-May-14 22:08 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 22:11
Jassim Rahma4-May-14 22:11 
AnswerRe: destroy session after sometime Pin
Kornfeld Eliyahu Peter4-May-14 22:17
professionalKornfeld Eliyahu Peter4-May-14 22:17 
GeneralRe: destroy session after sometime Pin
Jassim Rahma4-May-14 22:23
Jassim Rahma4-May-14 22: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.