How do I create an Upload Block

BruisedGhost - January 14, 2009 - 19:33

Hi All,

I am trying to create a block for a site that Im working on that essentially allows users to upload files, I have the view setup properly where users can see a list of files that they have upload but I cannot seem to create a block that is essentially a browse to file button.

Any suggestions?

Thanks

never mind

BruisedGhost - January 14, 2009 - 19:58

did it with html this will create a stand alone upload box

   
  <div class="content">
    <div class="attachments"><fieldset class=" collapsible"><legend>File attachments</legend><br />
<div class="description">Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.</div>
<div id="attach-wrapper">
<div id="attach-hide">
<div class="form-item">
<label for="edit-upload">Attach new file: </label><br />
<input type="file" name="files[upload]"  class="form-file" id="edit-upload" size="40" /></p>
</div>
<p><input type="submit" name="attach" id="attach-button" value="Attach"  class="form-submit" />

</div>
<p><input type="hidden" name="attach-url" id="edit-attach-url" value="http://mavenwebsolutions.com/_clients/trumpet/drupal-5.3/?q=upload/js"  class="upload" /><br />
<input type="hidden" name="vid" id="edit-vid" value=""  />
</div>
<p></fieldset></p>
</div>

scratch that

BruisedGhost - January 14, 2009 - 20:23

apparently you can browse for files but not submit the attached files, not sure why

I would create a file

jt_jones - January 14, 2009 - 20:50

I would create a file content type (cck and filefield modules) and allow users to create that content type. Add a link to the form in the block if need be.

Your files View should be filtered by the file content type.

did that

BruisedGhost - January 14, 2009 - 20:54

I have that setup already, the problem is that the person I am setting this up for doesn't want to have to click to many things and just wants the attachments block to be stand alone where you browse for a file and attach it without navigating anywhere else.

_

WorldFallz - January 15, 2009 - 02:25

If the upload form is by itself in a stand alone block, exactly what is it attaching to?

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

 
 

Drupal is a registered trademark of Dries Buytaert.