Added attachment upload function