ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
upload file to database has 0 kb (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: upload file to database has 0 kb
#8352
nmay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
upload file to database has 0 kb 1 Month, 3 Weeks ago Karma: 0  
I have the following:
Code:

<?php if(isset($_POST['upload']) && $_FILES['result']['size'] > 0) { $fileName1 = $_FILES['result']['name']; $tmpName1 = $_FILES['result']['tmp_name']; $fileSize1 = $_FILES['result']['size']; $fileType1 = $_FILES['result']['type']; } $fp = fopen($tmpName1, 'r'); $content = fread($fp, filesize($tmpName1)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName1 = addslashes($fileName1); } $user =& JFactory::getUser(); $userid = $user->get('id'); $database =& JFactory::getDBO(); $testquery = "INSERT INTO jos_uploads (userid, name, type, size, content) " . "VALUES ('$userid', '$fileName1', '$fileType1', '$fileSize1', '$content')"; $database->setQuery($testquery); if (!$database->query()) { echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script> "; } ?>
The problem is the uploaded file 's size is 0 kb. I am using windows xp. What's wrong? I had it worked on another machine.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/14 06:22 By GreyHead. Reason: added code tags
  The administrator has disabled public write access.
#8365
GreyHead (Admin)
Admin
Posts: 2801
graph
User Offline Click here to see the profile of this user
Re:upload file to database has 0 kb 1 Month, 3 Weeks ago Karma: 59  
Hi nmay,

Sorry, I've no real idea - this isn't ChronoForms code as far as I can see. Where are you putting it? Is the file uploading OK from the form?

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8393
admin (Admin)
Admin
Posts: 1570
graphgraph
User Online Now Click here to see the profile of this user
Re:upload file to database has 0 kb 1 Month, 3 Weeks ago Karma: 22  
Hi nmay,

you had it working with the same DB structure ? the field type to store the file is of which type ?

Max
 
Report to moderator   Logged Logged  
 
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
  The administrator has disabled public write access.
#8396
nmay (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:upload file to database has 0 kb 1 Month, 3 Weeks ago Karma: 0  
The above code was stored in auto generated code box, I had it working one time on a different machine. I am storing JPGs PDFs Zips users uploaded into MYSQL. But when I use MYSQLADMIN to download the file, it is 0 kb. I checked the upload folder, looks like files are there. I also changed var $mosConfig_fileperms = '0644';

And my debugging statement is telling me that $tmpName1 is C:\tempuploads\phpA.tmp (I am using windows) But nothing present in that folder, even I have full permission to that folder, tested , writable. $fp and $content are null, I guess that's why content (blob) is empty.

Could you please help me with it?
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/14 18:24 By nmay.
  The administrator has disabled public write access.
#8419
GreyHead (Admin)
Admin
Posts: 2801
graph
User Offline Click here to see the profile of this user
Re:upload file to database has 0 kb 1 Month, 2 Weeks ago Karma: 59  
Hi Namy,

ChronoForms moves the file from that temp folder into components/com_chronocontact/uploads. Do you see anything there?

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8458
admin (Admin)
Admin
Posts: 1570
graphgraph
User Online Now Click here to see the profile of this user
Re:upload file to database has 0 kb 1 Month, 2 Weeks ago Karma: 22  
Hi nmay,

from your words I understand that there is a problem uploading files to the server then, I think you should start by removing this code and trying Chronoforms upload tool, do your files get uploaded ? if not then there is something must be fixed on your machine, whats it exactly... I'm not sure, try contacting your host support, or if you have a local machine then you will need to configure something!

Cheers

Max

P.S: do you have FTP settings configured in your joomla admin ? may be this affecting it someway ? try to use the FTP functions ?
 
Report to moderator   Logged Logged  
 
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials