Questions tagged [files]
Use it to generally reference to those files used on websites which could be video, images, pdfs, etc.
2,461
questions
3
votes
1
answer
1k
views
Prompt user to download file via AJAX form submission
I have a file that is generated when an AJAX button is clicked. I want to immediately have a file download prompt come up. The file is being generated and has the correct data in the file. I just don'...
4
votes
1
answer
3k
views
How to rename uploaded files
Using Drupal 8, I want to rename and clean all filenames, e.g. If someone uploads file named like this Screen Shot 2016-03-29 at 1.13.21 PM.jpg, I want to clean it so that convert all spaces to dashes ...
1
vote
4
answers
3k
views
Ajax error while uploading or removing file through managed file
I am getting following error while using managed file through my custom form.
"An Ajax HTTP request terminated abnormally."
Also, I updated my jquery version to latest using jquery_update module. ...
0
votes
3
answers
2k
views
How to set and use direct files folder path in a multisite installation
Drupal 8 multisite install where
First site is on a subdomain one.example.com
Second site is in a subfolder one.example.com/two
How can files folder for both sites to be accessible via URL/files ...
2
votes
1
answer
209
views
Drush can't write to /tmp
Drush does not seem to be able to move files to the tmp folder on my local machine. Changing the tmp folder location to for instance "sites/default/files" works, but I would like to know why ...
3
votes
1
answer
3k
views
image field - how to overwrite existing image?
How to set up the image field in a content type so that it always overwrites images with the same name instead of creating new images with name suffix _0, _1 etc. Currently, while editing a node and ...
0
votes
1
answer
525
views
Preview is not showing after upload
When i am trying to upload image as a Authenticate user, After upload i am not able to see preview. fields got disappear fully.
If i try to do as a admin, i am able to see that.
Any suggestions?
0
votes
1
answer
2k
views
Large file uploads stop immediately, 404 error
I am having a weird problem with uploading large files in the Drupal admin's file field. I have the size limit set to 500 MB. I also have the php.ini settings for upload size, post size, and memory ...
0
votes
2
answers
546
views
embed photo album hosted on flickr.com using flickr module not showing photo album
I am attempting to use the Flickr module flickr-8.x-1.0-alpha2 along with Flickr API and Colorbox module to display a album of recent photos from Flickr.com.
I have setup the API keys. and added ...
1
vote
2
answers
378
views
Mapping existing file against a new content type
I am facing a situation here.
I have a content type A with an image field(field_upload_snaps) in it. There is another content type B which also contains an image field(field_valid_snaps).
Now user ...
0
votes
2
answers
531
views
How to disable a file upload button for anonymous users?
I've created a commerce add to cart form with a file upload field. The user can use this to upload a logo but I don't want anonymous users to be able to do this. I can see that the file module uses ...
-1
votes
0
answers
25
views
How to resize an uploaded image?
In Drupal 8, I have a content type "Sketch" that displays an attached image in several ways, depending on the view mode. Some views resize it to 200x200px, some to 600x600px.
I am trying to ...
0
votes
2
answers
373
views
How do I display self-hosted video content
What I am trying to do is embed a self-hosted video on a webpage. I have the video uploaded onto the web hosting in mp4, ogv and webm formats; converted where necessary using Miro Video Converter (if ...
0
votes
1
answer
520
views
Migrate Alt and Title text from a D6 image file field to D8
I'm trying to migrate a multi-value D6 image field to D8. I've already migrated the files with d6_file and it worked. When I do the node migration with the image field works and I get all the values ...
0
votes
1
answer
371
views
Webform multiple files with descriptions
D7: I am looking at building a competition section on a site I'm working on. Originally I started looking at Webforms to do this, but there are requirements I have that Webform doesn't solve (as far ...
0
votes
2
answers
766
views
The file names are not transliterated on upload
I am using Drupal 7 and have transliteration module enabled.
I have a file field and I want to have the names of the uploaded files to be transliterated on upload.
The url alias for the nodes are ...
1
vote
1
answer
1k
views
Can't load library path files
I have added a library to the libraries folder. I have the Libraries API module installed and I wrote this code:
function my_module_libraries_info() {
$libraries['google-api-php-client'] = array(
...
0
votes
1
answer
502
views
Move file uploads in webform into subdirectory using hook_webform_submission_presave
I'm using the webform_multiple_file module to let users upload files in a webform. There is a second form component in that form. It's a number.
I want to change the upload directory, which is defined ...
0
votes
1
answer
877
views
How to specify the correct private file path in a block
I have a Drupal site at http://example.org/xyz
Per the instructions here, I have set up a private file directory outside the web root.
So let's say the web root is at /home/public_html/example/xyz
...
0
votes
1
answer
1k
views
"The file phpC128.tmp could not be saved. An unknown error has occurred. File upload error. Could not move uploaded file."
I have Drupal 8.4 running on Windows Server 2016, and when trying to use an upload field on a content type I get this error
The file phpC128.tmp could not be saved. An unknown error has occurred.
...
-2
votes
1
answer
51
views
file_exists(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? [closed]
I just installed a bare boned Drupal 10 locally. and Windows 10 with PHP 8.1.14
I set the private file path as follows:
$settings['file_private_path'] = $app_root . '/../private';
Its path shows ...
1
vote
1
answer
380
views
Strip overlay context from File field
I have a basic File field set up to allow my users to attach files to nodes.
However, the File field widget in the node edit form displays files as a link to the file, and the URL contains #overlay-...
0
votes
1
answer
400
views
Can't get fid of the saved file after file_save_data
I have been trying to get the fid of the file which my custom module is saving and every time I end up getting the error "Trying to get property of non-object in report()". I have tried file_object->...
1
vote
1
answer
393
views
How to link an image with a PDF?
Actually, I have a content type with 2 fields, image field (multiple) which will contain some pictures and an attachment field (accept only one file) which is file of type PDF.
I have a view where I ...
0
votes
2
answers
804
views
File validation when the file field isn't required
I have a Drupal 7 custom form where the image or file field is not required. When the form is submitted and no file/image has been uploaded, I get the following errors.
Notice: Undefined index: ...
0
votes
1
answer
424
views
Error when uploading file through Drush on S3 volume
I am using Amazon S3 volume to store the node's attachment.
I keep having the following message:
file_put_contents(public:///.htaccess): failed to open stream: "DrupalPublicStreamWrapper::stream_open"...
0
votes
1
answer
471
views
for anonymous user, webform not submitted because of private file
I have one webform which contain the private file field.
As admin user: i can upload the file and submit the form.
As anonymous user: i can upload the file but while saving the form, i am getting '...
1
vote
3
answers
615
views
Uploading file, parsing and displaying data
For a site i am building right now, there is one component that I would want the user to upload a file, where it will be parsed (currently a python script, but can be ported to something else). The ...
3
votes
1
answer
377
views
Drupal prevents file save on chunked upload because of php.ini max upload size
I'm encountering a tricky problem with my custom file widget (which extends the core file widget). It chunks files so that I don't have to raise upload_max_filesize and post_max_size in php.ini, and ...
0
votes
1
answer
394
views
Unable to upload files through RESTful services
I am trying to upload pdf files to webform submission using REST API.
Since the Core File Upload functionality did not seem applicable for webform submission, I applied the patch from webform_rest ...
10
votes
8
answers
37k
views
The directory sites/default/files exists but is not writable and could not be made writable
We've recently had a few problems with our server, which seem to have been all patched up by myself, my host, and the cPanel team. However, since then we have been having problems with sites/default/...
0
votes
1
answer
3k
views
How upload a file\image via json api?
I'm trying to upload a file or image on a D9 site via json api. The test is namely to upload the user picture on the user entity.
I've been following the documentation or read questions about, but I ...
0
votes
1
answer
421
views
How to manage video content including chapter markers and CC
I'm building a site that has 46+ videos associated with it. I'm using Mediaelement.js. Each video has at least two language .srt files, a .vtt chapter marker file and two video sources, mp4 and WebM.
...
1
vote
1
answer
405
views
File upload ajax and Radio Buttons not cooperating in registration form
I have enabled Profile 2 and profile Profile2 Registration Path modules on my site and have a really long registration form with lots of fields. I have some radio boxes and file upload fields also. ...
2
votes
3
answers
2k
views
How to export custom module form content as PDF file in drupal 7?
I have a custom module with some form fields. I want to submit this form and generate pdf file of user filled values in new tab. I am trying with TCPDF but it doesn't display any fieldset ( as border )...
0
votes
2
answers
2k
views
RewriteRule causing internal redirect limit error
I am trying to server a static HTML site from /sites/default/files/staticsite and make it available via a subdomain. I'm hosting the site on Acquia Cloud, and their docs describe Maintaining a static ...
0
votes
1
answer
623
views
Adding zip archives to the Document File Type
I have many PDF documents in my site, assigned to the Document File Type by the File Entity Module.
I have added a few fields to the content type, thus allowing nice interface in showing all PDF ...
0
votes
0
answers
40
views
Public Access to Private Files
I have a content type that allows one or more file attachments and these are set as Private so that access to them can be controlled. A small percentage of these files I also want to be publicly ...
5
votes
2
answers
2k
views
Displaying the contents of a document file (doc, docx, etc.)
I'm looking for a way to display the contents of an uploaded document file such as a .docx file.
In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect ...
0
votes
2
answers
689
views
create link to download file
I'm adapting a drupal module to my need. It permit to upload a pdf to insert it into a node add form in an iframe to display the file.
I've need also to insert a link to download the previous uploaded ...
2
votes
1
answer
454
views
User can't access own private files via Views
I've set up a private directory sites/default/files/private and use it for a file field.
As an admin, everything works as expected when uploading and viewing a private file.
As a user who uploads ...
0
votes
2
answers
577
views
Image Files Uploaded via REST got Temporary status - Cannot be refereced by Media Image
Drupal 8.9.11
Image File Uploaded via REST gets "status - Temporary" while setting explicitly "status" case to True server error 403 (code in python)
"status": [
...
0
votes
0
answers
18
views
MSSQL - How to get a list of documents from a node that is using a space and a view?
I have a list of documents that are associated with a node of type space. The space has a page with a view and filter to list documents only related to that node.
I'm trying to query the database to ...
0
votes
1
answer
697
views
Module webform2pdf modify template
I have sereval webforms et each webform send a mail with a pdf. I would like to do a template for each webform.
I use webform2pdf in Drupal 7 to send pdf by email.
How can i do that ?
0
votes
1
answer
427
views
No working link to network files
For an intranet solution I would like to add a bunch of rather static links in Drupal to network files which change from time to time and are maintained by people not using Drupal.
To achieve this I ...
0
votes
1
answer
31
views
Why should a Drupal copy be extracted in the web directory?
I am trying to create a multi-site using Set up a multisite, but I do not understand the reason for step 1.2.
Why should a Drupal copy be extracted in the web directory?
There doesn't seem to be ...
0
votes
1
answer
797
views
Permission for private file to anonymous
I have an ad content type, with a file field that is in a private directory when saving the node.
Ads and their files are only accesible for authenticated users.
I wish I could allow anonymous users ...
0
votes
1
answer
2k
views
403 forbidden error when loading images in test server
Am working with drupal7.When images are loading below error is showing in my test site console:
GET sites/default/files/styles/slideshow_full/public/plans/30989/main-image/...
2
votes
1
answer
1k
views
#ajax on a managed_file custom form field is not working
I have a custom Drupal 8 form using a managed_file field with an #ajax callback but the ajax callback is never called (example below). I assume that it's because the managed file field type is already ...
0
votes
1
answer
968
views
Migrating files from local source are not found
I am migrating from Drupal 7 to Drupal 8 (8.6.9).
Both the Drupal 7 and the Drupal 8 site currently run on my local machine.
The migration of the public files goes well using:
source:
plugin: ...