Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




File Upload By Drag & Drop


Can anybody tell me how to upload a file by dragging it onto a web
page? Using the <input = "file" .....> it is possible to upload files,
but files cannot be dragged onto web pages for uploading.. Any
suggestions? I found a few Java based stuff but none of them were free.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag And Drop Insertion In MySql
I'm developing a site in PHP/MySql that requires Ajax for this feature
: The user read an article and if ever he likes it he can drag it and
drop it into his "basket". Then when he'll consult its account he'll
found that article.

Fix My AJAX Drag And Drop Code
I've been working on a drag drop system and something happened when I
tried to switch the code from a working model to one with another
database. The drag drop still works, but the informatin in the
database is still not updating. I kind of got aggravated and could not
figure out the problem with my 4 months of PHP experience.

If anyone would like to look over the code, then go tot his URL and get
in touch with me if interested!

Scriptaculous Drag Drop And Database Integeration!
I'm working on a drag and drop feature with the scriptaculous
javascript library. And I was wondering if someone could help me! :(

Here is some test code. Basically, when someone takes something from
the left side and puts it in the right side, I just want to run a
database query.

I have NO IDEA how to do this because of my limited javascript
experience.

<script
src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/prototype.js"
type="text/javascript"></script>
<script
src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/effects.js?1.7.0b1"
type="text/javascript"></script>
<script
src="http://www.mytuneslive.com/_NEW/MORPH/javascripts/scriptaculous.js"
type="text/javascript"></script>
<link rel="stylesheet"
href="http://www.wiki.script.aculo.us/stylesheets/application.css"
type="text/css" media="screen" />
<div style="height:200px;">
<div style="float:left;">
<h3>This is the first list</h3>
<ul class="sortabledemo" id="firstlist"
style="height:150px;width:200px;">
<li class="green" id="firstlist_firstlist1">Item 1 from first
list.</li>
<li class="green" id="firstlist_firstlist2">Item 2 from first
list.</li>
<li class="green" id="firstlist_firstlist3">Item 3 from first
list.</li>
</ul>
</div>
<div style="float:left;">
<h3>And now the second list</h3>
<ul class="sortabledemo" id="secondlist"
style="height:150px;width:200px;">
<li class="orange" id="secondlist_secondlist1">
<span class="handle">DRAG HERE</spanItem 1 from second list.
</li>
<li class="orange" id="secondlist_secondlist2">
<span class="handle">DRAG HERE</spanItem 2 from second list.
</li>
<li class="orange" id="secondlist_secondlist3">
<span class="handle">DRAG HERE</spanItem 3 from second list.
</li>
</ul>
</div>

PHP Upload Files Drop Into A Directory Based On The Name Chosen
I am using the existing upload script and would like to add the ability to have the files drop into a directory based on the name chosen from the drop down list on the form. Currently all files drop into the same directory all the user is notified via email. I want to keep the email notification ability. Code:

File Upload Issue - Unable To Upload A Large File
I am using PHP Version 4.4.3 under Linux/Apachie to upload files.
The PHP.ini upload_max_filesize is 2M, which I need to override this
in the HTML (see below). I changed the MAX_FILE_SIZE to 4,000,000
but the system only accepts files less than 2M.

Is the override wrong, do I need to raise the limit in the PHP.ini
file, or is the Apachie issue.

<form name="upload" action="admin.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">

Upload Jpg With Ftp -fine, Upload With Php Wrong File Type!
i've scripted a file uploader, about as basic as you can get, and works on all accounts except that it tells me every single jpg is the wrong file type - BUT i can ftp all these same images and they all behave correctly.

echo filetype($type_file);

//got this warning
Warning: filetype() [function.filetype]: Lstat failed for image/pjpeg
any ideas?

Need To Create Drop Down Box With Data Pulled From Text File
Trying to make a drop down box like this example:

Dog
Cat
Bird

But sometimes I will need to update it...and add/remove names from the list. I want to do it fast and easy and I don't want to use a MySQL Database. I'd rather use a text file...can that be done? I would keep the info in a text file and then push it to a drop down box via php and html.

Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one.  But without the radio buttons.

I want to have 3 drop downs but have no idea how to go about it.  I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.

Email With File Attachements - How To Upload File To Server From Browser?
I have a PHP script that sends an email with attachment and works great when
provided the path to the file to send.

However this file needs to be on the same server as the script.

I want to develop a webpage where people can send attachments that are
stored on their local PC.

I know I can use the <input type="file" > HTML to generate a file box that
allows the user to navigate to a file on their PC and product a file path,
but how do I then upload this file onto file server to email out with my PHP
email script?

Is there an easy way to do this?

Or can I approach this problem from a completely different angle.

PHP File Upload Unexpected Error - File Too Large?
I have a short basic script to upload files. It works fine with small files,
but with longer files it gets stuck.

Here's the fragment, the input file is loaded in "$file" from an HTML form
as usual.

....
$img_str = fread(fopen($file, "r"), filesize($file));
$data = addslashes($img_str);
// --------------------- up to here the execution is correct and fast (<1
second)

$sql="INSERT INTO $table (".
" file_name,".
" file_type,".
" file_size,".
" bin_data)".
" VALUES (".
" '$file_name',".
" '$file_type',".
" '$file_size',".
" '$data')";
// --------------------- it gets stuck
here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
mysql_query($sql) or die ("SQL error ..$sql");

I have already set the php.ini variables as follows:
memory_limit = 16M
upload_max_filesize = 6M

I also checked the execution time to max_execution_time = 300 (even though I
don't believe it should be necessary).
The server is a P4 1.8 GHz, 256MB RAM

File Upload Script - Testing For Existence Of File
i'm having a strange problem when processing some form data. I just want to validate that required fields have been populated, then, if an image has been uploaded, i want to ensure that a description of the image has been provided (for alt tag purposes) before processing the data.

For some reason, when a file hasn't been attached, my script interprets it otherwise and prompts the user for the alt tag. I've not come across this problem before, there's a good chance i've done something idiotic but i just can't see it Code:

File Upload - Directory Is Writable, File Is Not
I'm writing a script to upload images along with articles to a
directory on the server. I'm developing it offline on my WinXP and
Apache 1.3.x laptop and it's working great, but when I move the script
to the server, I get write errors when the file attempts to upload.

So I set up a test script (included below) to test the directory
structures all the way up to the file, and every directory appears to
be writable, yet I can't write to the test file. I keep seeing
suggestions to set the open_basedir directive in the php.ini file to
solve this, but it's hasn't worked yet. Can anyone suggest what I can
try to get the uploads working?

<?php

$filename = 'images/articles/test.txt'
$somecontent = "Add this to the file";

......

File Upload Handling (file Types Etc.)
I have two questions. First, how can I control what files a user uploads? I can, of course, check the extensions but they can't always be trusted. Can I check the mime-types somehow? Second, is there a way I can set the "available formats" in the file upload dialog box?

File Upload Works But Only For Empty File
I can upload a file as long as it is empty (thanks Hendri Kurniawan).
I do not know where to look.

Can someone help me understand what I need to do to upload a small image.
http://chops.novatrope.com/game/test/upload_file3.php

Here is some more info http://chops.novatrope.com/info.php

I Can Not Get File Uploads To Show Up When I Upload A File
I've a form that starts off like this:

<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">

<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawrence@krubner.com" /></p>

<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>

<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>

Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:

Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawrence@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

Display File Type Of Upload File
How do I display the file type of an uploaded file, in order to find out what mime type to use?

Drag Files From One Folder To Another Folder (copy) .. Possible?
Is it possible to write codings PHP or Javascript.. GUI representation
of File handling (ie. Drag files from one folder to another folder (copy)
like our windows).. pls give me some reference codings like this..

Multiple File Upload From Client Pc To Server Without Using <input Type="file"> Cont
I am working on a application which requires me to upload the contents of all the files from a particular folder in clent pc to the server.

In my code i just want to mention the folder name which may contain any number of files.Folder name will always be fixed.
I dont want to use <input type=file > control.

Is there any way i can achieve this using FTP or any other way in PHP.Any help will be greatly appreciated.

Upload File Gives A Blank File Name
I am having trouble with an upload script. Searched the forum but still couldn't fix it.
Here is the code: PHP Code:

Dynamically Populate Drop-down List And Dynamically Include Html File
We have a drop down list on a PHP page, with several product names, and
when people click one item, we will refresh the same page with the
product name as parameter, and in turn we want to include a HTML file
into the content area of the same page.

I know it is recommended to put everything into database, but we want
the web site to be very "portable", so the drop-downlist and the
content should both in text files.

Let's say the drop-down list will be poplulated from the product.txt
file, and there will be a file for each corresponding item in the
drop-down list. From the user point of view, if he wants to add a new
product, he will just need to open the product.txt file, and add a new
line with the product name, "Laptop", then add a new text file named
"laptop" in the same folder which contains the HTML fragment to be
included in the content area.

What is the easiest way to do this?

File Upload????
I need to upload mp3 files to either a database or a file. If it is uploaded to a directory, then I need somehow to put the address of the file into a database, can someone please guide me in this.

File Upload

I've tried to write a script to upload files. I'm using redhat and php3. I'm receiving the followind error:

Warning: Unable to create '/usr/local/apache/htdocs/rex/admin/test/html40.zip': Permission denied in /usr/local/apache/htdocs/rex/admin/test/test.php3 on line 40

What rights should i set ? I've tried all the combinations for owners and rights URL but it doesn't work....

File Upload
Here is the situation. I have a 'Comments' box on a HTML page where a user will enter some comments. Once the submit button is pressed, the comments show up on a PHTML page(summary).
I am now trying to place a File Upload option on the HTML page also, whereby I want the user to be able to enter comments, select a File, then only press 1 Submit button that will then show both the Comments and the File on the PHTML page.

File Upload
Hi,

I am writing an admin section for estate agent website and want only the authorised admin user(s) to be able to upload images to upload folder. I already implemented admin login through session variables. Is this enough or do you need to secure the upload folder as well?

How should you check that PHP has the correct rights
to write files to the secured folder you want to upload files/images to.

File Upload
I'm trying to get a file upload to work and it's not happening. Here's my
form code...

File Upload
I am using php3 and am trying to upload a file with the following code. When i try to upload it sets $filename to /var/tmp/phpDAA...

I don't know why it's doing this. Anyone have any ideas on how to fix this? I do not have access to / my private directory is in /opt2/company_name/ ,more info code:

File Upload
Hi all, this might be more of an html question but I think it can be done in
PHP, so I will ask here.

I have an html form that allows for .pdf file uploads. This script will
serve two functions 1) upload a .pdf file to a specific directory on the web
server and 2) create an entry into the db that includes the name of the file
just uploaded. I want to have another web page that will dynamically list
all of the names of the files uploaded as clickable hyperlinks so they can
view those .pdf files.

I have the file upload code working just fine, but the name that gets
written to the database as something like: "/tmp/phpTg2toF", which is not
the name of the file. How can I "get" the name of the file that I upload so
that it can be written into the db as a file name? Anyone have ideas? Thanks
in advance. Here is my code:

File Upload
I am trying to create a page with a file upload dialog box and am using the following code -

[html]
<FORM METHOD=POST ENCTYPE="multipart/form-data" ACTION="showname.php">
File to upload: <INPUT TYPE=FILE NAME="upfile"><BR>
<INPUT TYPE=SUBMIT VALUE="Submit">
</FORM> [/html]

The showname.php page is :

<?
$filename=$_POST['upfile'];
print "File name is $filename";?>

When I do this the $filename is reported as a null string. Even if I do not use the choose button and just type in text in the box, I still get nothing. If however, if I remove the "TYPE=FILE", so that the first page is a normal text box, the result page shows whatever was typed in.

File Upload
I have 2 files, one is a HTML file with the code to create a Browae and Submit Button for uploading a file. (This works fine). BUT, when I click the submit button, I want the file to upload to a directory on my C:/ drive which I have indiciated in the PHTML file, but I keep getting the following error and I don't know why.

Warning: Unable to open 'php2' for reading: Unknown error in C:apachehtdocs/submitassprac.phtml on line 5 Couldn't copy the file! OR

Warning: Max file size exceeded - file [img1] not saved in C:apachehtdocs/submitassprac.phtml on line 0 Code:

File Upload
i'm using php 4.2.1, iis and win2kpro. my problem is when i try the file upload, my image is not uploaded to the folder. PHP Code:

File Upload
ok, I have a file upload secton to my site, two pages, one with a
form and one that does the uploading.... some files upload fine, other
don't

an exe of 300k will upload, but a word document of 40k wont and so on,
in the php.ini a limit of 2mb is set (I haven't changed it, it's how
the file originally as, so it isn't my maths that's gone mad).....

File Upload
I have a form containing text input, checkboxes and a file upload (all in
one form). The file has the a name = foto. When I try to check the name of
the file in nieuwsVoegToe.php I get Notice: Undefined index: foto in
C:InetpubwebpubNavigatorhtmlpublic_html
ieuw sVoegToe.php . I use
$_naam = $_FILES['foto']['name']; to get the name of the file. Someone knows
wat's going wrong?

// THE UPLOAD FORM
<form name="nieuws" method="post"
action="nieuwsVoegToe.php?actie=nieuw&IDN=">
Titel <input class="grijs" name="titel" type="text" size="40">
<textarea class="grijs1" name="inhoud" cols="80"
rows="8"></textarea><br><br>

foto toevoegen? <input name="fotoToevoegen" type="checkbox" value="1"
onSelect="EnableInput();"><br>
<table class="grijs" bgcolor="#EEEEEE" >
<tr><td>
selecteer je foto:
<input type="hidden" name="MAX_FILE_SIZE" value="20000">
<input type="file" name="foto">
</td></tr>
<tr>
<td>
// radiobuttons here
</td>
</tr>
</table><br>
<input class="grijs" type="submit" value="nieuws toevoegen >>">
</form>

File Upload
I cant get my php script to upload a file to the default dir. I have
checked all the php.ini variables and made sure there is a default
temporary dir, as soon as i submit it just reloads the page. this is my
form

<form enctype="multipart/form-data" action="<?php echo
$_SERVER[PHP_SELF]; ?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

Upload A File
I am trying to upload a file to a folder in my c: drive but i get a stupid error I am doing this for the first time. Can anyone send me a simple script to upload a file to a folder? Code:

File Upload
The problem is everytime I upload an image/spreadsheet/etc... the file comes back corrupted. You'll notice if you try to upload an image that when it shows the image it is distorted. I also find it strange that the image seems to be double the original size everytime. Source code is attached to the document. I am having this problem with copy() also.

File Upload
I'm currently trying to get a file upload form to work, the original I started with came from this sites tutorial.. No matter what I tries, I gets messages like "Warning: Unable to create '/images/': No such file or directory in /Users/victor/Sites/foto/upfile.php on line 33"

/images has 777 properties. The form code is:

File Upload
I've had a script working that uploads a file. Now, since upgrading to PHP 4.3 and Apache 2.0.44, the input field's name-variable key doesn't even show up: $_FILES[$key]["name"], but all other variables from the form are coming in just fine.
Is there something new to php 4.3?

PHP File Upload
I am using the following functions to upload an image, and store it to the database. the format for the image in database table is mediumblob. PHP Code:

File Upload
I’m getting the following errors when I try to run the script below on a live server. It’s a crude script which uploads text and images directly into MySQL. It works fine on my local machine, I have Apache, PHP4 and MySQL running on windows. The live server is Unix.

When I try to upload images from my loacal pc I get the error below, when I placed an image file within the same directory as the script on the live server and tried to upload it that worked. I wanted the script to allow image uplload from a client pc Can anyone offer a suggestion?

Warning: fopen("C:Apachehtdocs Grey.jpg", "r") - No such file or directory in /usr/local/home/httpd/vhtdocs/sitehostin/moondance/backend/test_imagedb.php on line 57
Code:

MP3 File Upload
I am trying to set up a pod-casting administrative service for a
client, but seem to be having troubles with the MP3 Uploads,
specifically, they don't upload!

My testing server for this specific problem is:

mp3.php simply print_r's the $_FILES superglobal.

Right now, I am not going for secure, just working! As you can see, the
array seems to have nothing in it, and I am getting really frustrated.

File Upload
I want to make a file upload using php, but everytime i get an error
"File name not given". Any hints why this is happening? I used a sample
from php.net, and other php sites, but all samples are basically the
same. Maybe someone from you has a good and working example?

File Upload
I am trying to create a script to upload a file. the problem is that I wish to upload the file to a separate server than the script is located on. The server receiving the files can't run php.

File Upload
i can upload small files. hoeever i cannot upload bigger files-but
max_file_size is set correctly. what can be wrong? is it connected witrh
my browser?

File Upload
I just just got a html/php file upload to work using the copy function, but copy() still returns false and prints the error message saying that the upload failed. It returns false even though the file has already been uploaded to the correct place. Here is my code:

if (!copy($userfile,"$newfile"))
{
print "Error Uploading File.";
exit();}

File Upload
Q1. i wonder can we get rid of "browse" button instead of the one textfield and one button beside?

<form name="form1" method="post" action="addevent.php3" enctype="multipart/form-data">
<input type="file" name="userfile" size="40" maxlength="100">
<input type="submit" name="submit" value="Add">
</form>

File Upload
I'm trying to upload an mpeg file to a folder created on a server running Apache. I have tested this code on my machine which has w2k and php 4 installed and it works fine. But when I try and run this on the server running Apache I get the following error:

Warning: Unable to create '/data/htdocs/elders/listing_vids/12445.mpeg': Permission denied in /data/htdocs/elders/branch/admin/realimage_man/do_upload.php on line 32
Can't copy breakdance3.mpeg to 12445.mpeg

Would anyone know what the problem is?

File Upload
I want to know how to read a file from my computer and not on the web server. For example, I upload the script to my web server and view it from my home computer. How can I make the script read the file from my computer? I am wanting it to read the file and write it to a new file with the same name on my web server.

Upload A File Without IE
I am able to upload a file with an HTML form submitting to a PHP script. That is fine for uploading with the browser, but I need to upload from a FoxPro application without opening the browser.

If I try to send the variables (file name) to the PHP script in the URL it fails. I believe this is to protect people from sites grabbing files they should not see. But how can I get around this security thing?

PHP 5 On IIS 6 File Upload
I have started running IIS 6 and PHP 5 and am experiencing a problem with
limited size on file upload.

The php.ini file has been altered for both post and upload sizes

I have checked the MetaBase.xml to increase the value for
AspMaxRequestEntityAllowed. I have seen a reference to
MaxRequestEntityAllowed but cannot find it anywhere.

I seem to be limited to files under 5mb but haven't found the exact limit
yet.


Copyright © 2005-08 www.BigResource.com, All rights reserved