uploading file problem with RC4 (and 3?)

Please post your suggestions or any hacks you have made here

uploading file problem with RC4 (and 3?)

Postby gg4j on Wed Dec 26, 2007 10:37 pm

Hi guys,

I have my form in J RC1.

It works pretty fine.

I wanna set up RC4.

I copy the form (via database)
and simply NO DATA are stored.

If I generate a new one, it will work but no uploading file!!!
No file uploaded, and as well no filename stored in the table.
Other fields are ok.

Here's the code I copied from the original.

Code: Select all
<?php
$database =& JFactory::getDBO();
   
$database->setQuery( "INSERT INTO #__chronoforms_5 VALUES  (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['name']."' , '".$_POST['email']."' , '".$_POST['ricetta']."' , '".$_POST['ingredienti']."' , '".$_POST['preparazione']."' , '".$_POST['consigli']."' , '".$_POST['origine']."' , '".$_FILES['allegato']['name']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
and this is the form
Code: Select all
<h2>Ricette per palati Multi Culturali</h2>
<p><fieldset class="orange"><legend class="orange"><strong>Benintegra il palato!!</strong></legend>
Inviaci una ricetta tipica dei tuoi luoghi di origine.
Benintegrati preparerà per tutta la comunità la
scheda della tua ricetta, da stampare, conservare, preparare e....
gustare!!<br>
<strong>Fai sentire come si mangia a casa tua!</strong></fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Lo Chef</strong>
</legend>
<dl class="ccform">
  <dt class="ccform"> <label for="name">Il tuo nome:<b>*</b></label>
  </dt>
  <dd class="ccform"><input name="name" id="name" type="text">
  </dd>
  <dt class="ccform"> <label for="email">La tua e-mail:<b>*</b></label>
  </dt>
  <dd class="ccform"><input name="email" id="email" type="text">
  </dd>
  <dt class="ccform"><label for="ricetta">La ricetta:<b>*</b></label>
  </dt>
  <dd class="ccform"><input name="ricetta" id="ricetta" type="text"> </dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Ingredienti</strong>
</legend>
<dl class="ccform">
  <b>Campo obbligatorio*</b>
<dt></dt>
<dd><textarea cols="30" name="ingredienti" id="ingredienti" style="height: 63px; width: 612px;" rows="3"></textarea>
    <span class="hint">Se usate dei preparati non
comuni, dite in linea di massima cosa sono o
come sono fatti.<span class="hint-pointer"> </span></span>
  </dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Come si fa?</strong>
</legend>
<dl class="ccform">
<b>Campo obbligatorio*</b>
<dt></dt><dd><textarea cols="30" name="preparazione" id="preparazione" style="height: 63px; width: 612px;" rows="3"></textarea>
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Consigli in Cucina</strong>
</legend>
<dl class="ccform">
<dt></dt>
  <dd class="ccform"><textarea cols="30" name="consigli" id="consigli" style="height: 63px; width: 612px;" rows="3"></textarea>
    <span class="hint">Qualche dritta per fare diventare il tutto più buono e appetitoso?!<span class="hint-pointer"> </span></span>
  </dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Origine</strong>
</legend>
<dl class="ccform">
  <label for="origine">Indica la Regione, il
Paese o
l'Area Geografica di provenienza del tuo piatto.<b>*</b></label><br>
<dt></dt>
  <dd class="ccform"> <input name="origine" id="origine" type="text">
</dd>
</dl>
</fieldset></p>
<p><fieldset class="orange"><legend class="orange"><strong>Come si presenta?</strong></legend>
<dl class="ccform">
  <label for="allegato">Allega una foto del tuo
piatto!
Servirà a distinguerlo. Puoi provare ad inviare anche le
foto del tuo cellulare.</label><br>
<dt></dt>
  <dd class="ccform"> <input name="allegato" id="allegato" type="file">
    <br>
    <small>*.jpg, *.png, *.gif, *.tif
    </small><span class="hint">Dimensioni Max 3072
Megabyte<span class="hint-pointer"> </span></span></dd>
  <br>
</dl>
</fieldset>
<p><input value="Invia" name="submit" type="submit"><input value="Cancella" name="reset" type="reset">
Any idea of that?

Edited to add code tags and remove some empty lines<br><br>Post edited by: GreyHead, at: 2007/12/26 19:47
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby GreyHead on Thu Dec 27, 2007 12:49 am

Hi gg4j,

There was a bug in the J1.5 release that prevented file uploads. It's just one line that has to be corrected. The bug is fixed in the current download and there was an amended version of chronocontact.php posted to the forums recently.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3788
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:uploading file problem with RC4 (and 3?)

Postby gg4j on Thu Dec 27, 2007 1:17 am

.......mm
well, I remember there was a bug, cant remember if in RC1, in joomla I mean, or in CC...

Maybe I've fixed it in RC1 version I have, that' s why maybe my form uploading works.

I can't remebmber that fix...

Could you give me the reference of that post please?
I can't find it... chronocontact.php is a slightly too generic search key...



Thank you so much!!!:cheer:
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby gg4j on Thu Dec 27, 2007 2:42 am

Well, I tryed the amended php file in this thread but no uploading is done anyway...

I even try to overwrite the one I use in RC1 in RC4, no results as well..

But the form does upload in the RC1... That's why I cannot understand why not in RC4...

:sick:

Edited to add url tag<br><br>Post edited by: GreyHead, at: 2007/12/27 13:17
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby GreyHead on Thu Dec 27, 2007 6:18 pm

Hi gg4j,

Sorry, I've no idea what might have changed in Joomla 1.5RC4, I expect that Max will release a new beta version of ChronoForms in the next week or two.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3788
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:uploading file problem with RC4 (and 3?)

Postby admin on Fri Dec 28, 2007 8:22 am

Hi gg4j,

If the upload is working at the Joomla RC1 site you had then please copy chronocontact.php to the new Joomla Rc4 website you have and it should work!! if not then assure all directories permissions are good, like the upload directoy is set to 775 or 777 if needed!

Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4039
Joined: Mon Aug 14, 2006 5:29 am

Re:uploading file problem with RC4 (and 3?)

Postby admin on Fri Dec 28, 2007 8:26 am

Another note about the auto generated code, please change the table name at the new site to reflect the new form ID, the forms IDs is shown at the forms management page, please change this word at the code : #__chronoforms_5 so that the 5 is replaced by the new id :)

Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4039
Joined: Mon Aug 14, 2006 5:29 am

Re:uploading file problem with RC4 (and 3?)

Postby gg4j on Sat Dec 29, 2007 10:22 pm

Hi folks,

so RC4, with CC version 2.51a
copyed chronocontact.php from old 2.51 working fine in RC1, copied onto RC4

checked ID: there is ID 1 for table_1
(UI copyed the old RC1 database onto RC4)

no file is uploaded.

Please not that there is the name of the file in recorded data, but no file into the directory upload...

Notice: Undefined offset: 1 in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 231

Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 232

Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 233

Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297

Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 300

Notice: Undefined index: reset in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297

Notice: Undefined index: reset in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 300

Notice: Undefined index: Ricette Benintegrate! in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 454


Maybe this could help:
"allegato stands for the uploaded file.
Notice msgs after sending form.

code:
Code: Select all
<?php
$database =& JFactory::getDBO();
   
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES  (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['name']."' , '".$_POST['email']."' , '".$_POST['ricetta']."' , '".$_POST['ingredienti']."' , '".$_POST['preparazione']."' , '".$_POST['consigli']."' , '".$_POST['origine']."' ,  '".$_POST['colore']."' , '".$_FILES['allegato']['name']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
and the form:
Code: Select all
<h2>Ricette per palati Multi Culturali</h2>
<p></p>

<br>


<p>
<fieldset class="orange"><legend class="orange"><strong>Benintegra il palato!!</strong></legend>

Inviaci una ricetta tipica dei tuoi luoghi di origine.
Benintegrati preparerà per tutta la comunità la
scheda della tua ricetta, da stampare, conservare, preparare e....
gustare!!<br>
<strong>Fai sentire come si mangia a casa tua!</strong></fieldset>
</p>
<br>


<p>
<fieldset class="orange"><legend class="orange"><strong>Lo Chef</strong>
</legend>
<dl class="ccform">

  <dt class="ccform"> <label for="name">Il tuo nome:<b>*</b></label>
  </dt>

  <dd class="ccform"><input name="name" class="required" id="name" type="text">
  </dd>

  <dt class="ccform"> <label for="email">La tua e-mail:<b>*</b></label>

  </dt>

  <dd class="ccform"><input name="email" class="required validate-email" id="email" type="text">
  </dd>

  <dt class="ccform"><label for="ricetta">La ricetta:<b>*</b></label>
  </dt>

  <dd class="ccform"><input name="ricetta" class="required" id="ricetta" type="text"> </dd>

</dl>

</fieldset>
</p>



<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Ingredienti</strong>
</legend>
<dl class="ccform">

  <b>Campo obbligatorio*</b>

<dt></dt>
<dd><textarea cols="30" name="ingredienti" class="required" id="ingredienti" style="height: 63px; width: 612px;" rows="3"></textarea>
    <span class="hint">Se usate dei preparati non
comuni, dite in linea di massima cosa sono o
come sono fatti.<span class="hint-pointer"> </span></span>
  </dd>
</dl>

</fieldset>
</p>
<br>


<p>
<fieldset class="orange"><legend class="orange"><strong>Come si fa?</strong>

</legend>
<dl class="ccform">

<b>Campo obbligatorio*</b>
<dt></dt><dd><textarea cols="30" name="preparazione" class="required" id="preparazione" style="height: 63px; width: 612px;" rows="3"></textarea>
</dd>
</dl>

</fieldset>
</p>
<br>


<p>

<fieldset class="orange"><legend class="orange"><strong>Consigli in Cucina</strong>
</legend>
<dl class="ccform">
<dt></dt>
  <dd class="ccform">
    <input name="consigli" type="text" id="consigli" style="height: 63px; width: 612px;" value="" size="30" maxlength="314">
    <span class="hint">Qualche dritta per fare diventare il tutto più buono e appetitoso?!<span class="hint-pointer"> </span></span>
  </dd>

</dl>

</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Origine</strong>
</legend>
<dl class="ccform">

  <label for="origine">Indica la Regione, il
Paese o
l'Area Geografica di provenienza del tuo piatto.<b>*</b></label><br>
<dt></dt>
  <dd class="ccform"> <input name="origine" class="required" id="origine" type="text"> </dd>
</dl>
</fieldset>
</p>
<br>
<p>
<fieldset class="orange"><legend class="orange"><strong>Come si presenta?</strong></legend>
<dl class="ccform">
  <label for="allegato">Allega una foto del tuo
piatto!
Servirà a distinguerlo. Puoi provare ad inviare anche le
foto del tuo cellulare.</label><br>
<dt></dt>
  <dd class="ccform"> <input name="allegato" id="allegato" type="file">
    <br>
    <small>*.jpg, *.png, *.gif, *.tif
    </small><span class="hint">Dimensioni Max 3072
Megabyte<span class="hint-pointer"> </span></span></dd>
<p>
<label for="colore">Infine, dài un colore alla tua ricetta...:</label>
<dt></dt>
<dd class="ccform">
<select name="colore" id="colore" size="1"  title="colore">
<option value="rosso" id="col_rosso">rosso</option>
  <option value="arancione" id="col_arancione">arancione</option>
  <option value="giallo" id="col_giallo">giallo</option>
  <option value="verde" id="col_verde">verde</option>
  <option value="azzurro" id="col_azzurro">azzurro</option>
  <option value="rosa" id="col_rosa">rosa</option>
  <option value="viola" id="col_viola">viola</option></select>
</dd>
</p>
  </br>
</dl>
</fieldset>
<p>
<br>
<input value="Invia" name="submit" type="submit"><input value="Cancella" name="reset" type="reset">


Edited to clean up tags<br><br>Post edited by: GreyHead, at: 2007/12/29 18:53
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby gg4j on Sat Dec 29, 2007 10:26 pm

hei maybe I found the trick!!!

Hei guys,

I checked now the "fiel uploads" section,
and I found that here:
Field names & allowed Extensions for each:
E.g: field_name_1:jpg|gif|doc|zip, field_name_2:rar|avi , * = all are ok

the value already showned is "array".

I tryed to change it with:
allegato:jpg|gif|...
(allegato is my input name)

saved, but if you check again, you'll find that there will be still "array" instead of the "allefato:..."


That's make sens for:
Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 232

Notice: Undefined index: Array in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 233

Notice: Undefined index: allegato in c:\programmi\easyphp1-8\www\rc4\components\com_chronocontact\chronocontact.php on line 297


Don't you think?
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby gg4j on Sat Dec 29, 2007 10:31 pm

Image
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:uploading file problem with RC4 (and 3?)

Postby GreyHead on Sun Dec 30, 2007 12:15 am

Hi gg4,

I just posted in the 'Bugs' thread that there seems to have been a coding change in RC3/4 that breaks the way that ChronoForms stores these parameters. Hopefully Max will be able to work out a fix for it soon.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3788
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:uploading file problem with RC4 (and 3?)

Postby admin on Tue Jan 01, 2008 7:37 am

Hi gg4j,

I will try to release a new fixed version ASAP, as Bob mentioned there is some code change in Joomla core which resulted into this!

Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4039
Joined: Mon Aug 14, 2006 5:29 am


Return to ChronoForms Suggestions & Hacks

Who is online

Users browsing this forum: No registered users and 1 guest

cron