We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

File

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

silvia, i’m not getting that 404 error, what field are you placing the chosen file into? what URL is coming up as a 404? the /system/index.php url?

       
tpayton's avatar
tpayton
172 posts
18 years ago
tpayton's avatar tpayton

Mark, fantastic job on this extension. Made my day when i found it.

  • T. Payton
       
tpayton's avatar
tpayton
172 posts
18 years ago
tpayton's avatar tpayton
I’ve updated the extension to 1.1.0. It fixes just a few small bugs where incomplete URL’s were being added to the template where no image was uploaded. Also if you’re using this extension in the SAEF you’ll have to modify your mod.weblog_standalone.php file within the /system/modules/weblog/ folder. Find the following line:
$data = array(
'hidden_fields' => $hidden_fields,
'action'        => $RET,
'id'            => 'entryform',
);
and add this line
'enctype' => 'multipart/form-data'
so it looks something like this
$data = array(
'hidden_fields' => $hidden_fields,
'action'        => $RET,
'id'            => 'entryform',
'enctype'        => 'multipart/form-data'
);

So I made these mods for using with SAEF, however, my form is still only just showing the field label without a text field entry, or better yet a browse button. Do you have to hard code the field in the form or should the entry form loop of custom fields pick it up? I tried to add an “if file” to the entry form logic but no avail:

{if file}
<input type="text" dir="{text_direction}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" onclick="setFieldName(this.name)" />
{/if}

Any thoughts?

  • T. Payton
       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

tpayton, because of the way the saef is implemented you’ll have to hardcode the form field. I think the way other people have done it is to just copy-paste the field’s source from the control panel… maybe someone else can chime in on how they managed to implement this?

       
Low's avatar
Low
407 posts
18 years ago
Low's avatar Low

I get this error in the Control Panel (CP Home › Admin › Weblog Administration › Field Groups › Custom Fields) when the first field in the group is a ‘File’:

Notice: Undefined variable: field_type in [...]/cp/cp.publish_ad.php on line 5470

If I change the type to ‘text’, or if the File field isn’t the first one, no notice is given. Can anyone confirm this?

(File extension 110, EE 1.5.2 build 20070126)

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

try this: http://ellislab.com/forums/viewthread/38843/#181791

       
Low's avatar
Low
407 posts
18 years ago
Low's avatar Low

Check. Thanks, Mark.

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.

One issue and one question 😊

Only the last file is uploaded even though I have put multiple files in the entry. I can go back and edit and it will add one more new one (if I enter 3 in the edit form, again only the last of the 3 is added to whatever is already there).

And a question:

How do you show all multiple files in a template? If I just put {my_file_field) it only gives the first one?

Thanks!

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

check here for the syntax: http://ellislab.com/forums/viewthread/38997/#181203 and as for your problems uploading multiple files, what browser and OS are you using? I’ll have to debug that I haven’t seen it before.

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.

Mark I’m on OS X (10.4.8) using FF, although I’ve tried in Safari as well as XP IE 6. Hmmm - I just tried updating an entry again that has one file already, and it wouldn’t upload any new ones at all - just keeps the one existing one.

I’m guessing it’s probably a conflict with another extension I have loaded? I’m using these extensions:

Custom Fields in EE Tags Disable pMachine News Feed File Geo Coordinates Multi Text

I have a geo coord field, a file field and a multi-text field all in this entry form. Could that be an issue?

       
Brian M.'s avatar
Brian M.
529 posts
18 years ago
Brian M.'s avatar Brian M.

Mark - once again I should have kept digging before posting my issue. Turns out I was hitting file size limits on the files I was trying to upload. I think error reporting would be a good idea on this extension!

Sorry for crying wolf…

       
lithiumdave's avatar
lithiumdave
215 posts
18 years ago
lithiumdave's avatar lithiumdave

Hi,

I’ve had the ‘file’ extension running on a few sites recently with no problems, but with this particular site I’m working on I keep getting an error at the top of any entry page where i’ve previously uploaded a file:

Notice: Uninitialized string offset: 0 in /path_to_web_root/system/extensions/ext.file.php on line 420

I’ve cleared caches and have upgraded to EE Core 1.5.2 (Build: 20070126) (I was previously EE Core 1.5.0)

I’ve tried deleting whole entries and starting again, but still the same error. No problem when first opening the entry (before uploading a file) and no problem further if I don’t actually upload anything, only once returning to edit the entry containing an uploaded file.

The files get uploaded using the extension no problem at all, just the weird error at top of page. I’ve done a search of the forums but only find solutions to clear the cache, which I’ve done.

Any help very much appreciated, many thanks!

PS: I’m using File 1.0.7

       
Mark Huot's avatar
Mark Huot
587 posts
18 years ago
Mark Huot's avatar Mark Huot

hum…file 1.0.7 is rather old. this should be fixed in the version at the top of the thread.

       
lithiumdave's avatar
lithiumdave
215 posts
18 years ago
lithiumdave's avatar lithiumdave

Ah! I presumed the one on your site would be up-to-date. Thanks very much Mark : )

Dave

       
Helmi_xisnet's avatar
Helmi_xisnet
71 posts
18 years ago
Helmi_xisnet's avatar Helmi_xisnet

Hi Mark, i really like this extension. Is there any chance I can set multiple file/single file upload per weblog?

       
First 4 5 6 7 8 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.