Working with files in Drupal 7

Drupal 7 has replaced the old Upload module (which provided the “Attachments” feature on nodes) with a FileField (as FileField is now in core). So, while there’s no longer the option to enable attachments for the content type within the main page of the content type edit form, you can now add a new File field to the content type. Once you’ve saved the new field for your content type, the upload form will appear on the edit page for nodes of that type.

Since in Drupal 7 both nodes and comments are “entities”, you can attach fields to both in the same way. When Comment module is enabled and you click to edit one of your content types, you’ll see both a Manage Fields tab (for fields on the node) and a Comment Fields tab (for fields on the comments for this particular content type).

ที่มา : https://drupal.org/node/1026432

จากข้อความด้านบนสรุปได้ว่าโมดูล Upload ใน Drupal 6 ไม่มีแล้วใน Drupal 7 เพราะมีการสร้าง FileField ไว้ในแกนหลักของ Drupal 7 แล้ว การจะใช้งานก็ให้ไปทำการเพิ่มฟิลด์ให้กับ Content type ที่จะใช้ เช่นต้องการให้ Article สามารถทำการ Upload ไฟล์ได้ ก็ให้ไปเพิ่มฟิลด์ที่ Article ดังรูป

File_Attatchment

หลังจากกด Save จะแสดงหน้ากำหนดค่า

File_Attatchment2

การกำหนดค่าที่สำคัญคือ file extension ซึ่งปกติจะมีแต่ txt แต่ถ้าต้องการให้ Upload ไฟล์ชนิดอื่นได้ด้วย ให้เพิ่ม file extension คั่นด้วย comma ดังรูป

File_Attatchment3

ที่มา : https://drupal.org/documentation/modules/file